Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DbxDownloader.close() throws java.lang.IllegalStateException: Unbalanced enter/exit #237

Open
DanyGZ opened this issue Feb 22, 2019 · 1 comment

Comments

@DanyGZ
Copy link

DanyGZ commented Feb 22, 2019

Hi, I'm trying to cancel a download. My way to cancel is this.

public void cancelDownload(){
          if (m_dbxDownloader != null) {
              dbxDownloader.close();
              dbxDownloader = null;
          }
    }

When I call dbxDownloader.close(); is thworing an exception. The exception is this

2019-02-22 09:53:14.576 26079-26412/com.toshiba.dse.ebridge.acme.lite E/ExceptionHandler: java.lang.IllegalStateException: Unbalanced enter/exit
        at com.android.okhttp.okio.AsyncTimeout.enter(AsyncTimeout.java:62)
        at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:209)
        at com.android.okhttp.okio.RealBufferedSource.read(RealBufferedSource.java:60)
        at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:466)
        at com.android.okhttp.internal.Util.skipAll(Util.java:164)
        at com.android.okhttp.internal.Util.discard(Util.java:146)
        at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.close(HttpConnection.java:483)
        at com.android.okhttp.okio.RealBufferedSource.close(RealBufferedSource.java:421)
        at com.android.okhttp.okio.RealBufferedSource$1.close(RealBufferedSource.java:409)
        at com.dropbox.core.util.IOUtil.closeQuietly(IOUtil.java:149)
        at com.dropbox.core.DbxDownloader.close(DbxDownloader.java:131)

Is this a problem with SDK?

@greg-db
Copy link
Contributor

greg-db commented Feb 22, 2019

[Cross-linking for reference: https://stackoverflow.com/questions/54831226/dbxdownloader-close-throws-java-lang-illegalstateexception-unbalanced-enter-e ]

Thanks for the report! It looks like we'll need some more information to reproduce and investigate this. Can you share the following pieces of code:

  • how you're building your request config
  • how you're building your client
  • how you're making the downloader
  • whatever you're doing with the downloader, including any downloading and when you call cancelDownload

Additionally, please let me know what version number of okhttp you have installed.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants