question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When Authenticator.authenticate() throws an exception the StreamAllocator isn't released

See original GitHub issue

First of all sorry for not providing a failing test here, but I struggled to do that for this case.

I was just implementing an Authenticator when I found that when Authenticator.authenticate() throws an exception (it has a catched IOException in its signature, so that seems to be an expected case) the RetryAndFollowUpInterceptor will never release its StreamAllocation - as opposed to when returning null in authenticate().

Here are the according lines in the RetryAndFollowUpInterceptor:

Request followUp = followUpRequest(response, streamAllocation.route());

if (followUp == null) {
    if (!forWebSocket) {
      streamAllocation.release();
    }
    return response;
}

Shouldn’t there be a try catch around the call to followUpRequest() to handle that case and and then re-throw the exception?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
CMaheshcommented, Feb 23, 2018

https://github.com/square/okhttp/pull/3885

changes commited and pull request created.

1reaction
CMaheshcommented, Feb 22, 2018

I am new to open source community. Can I work it ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Troubleshooting Methods
Below we will cover some of the most common troubleshooting methods and techniques you can try when something isn't working.
Read more >
App - StreamLocator
Love this app for accessing different geo locations on Netflix and Prime. Its basic and simple to use and streaming is good. It...
Read more >
How to watch Paramount+ outside the USA - StreamLocator
Paramount+ streaming theatre movies. Another big bonus is that Paramount Plus will be streaming many blockbuster movies shortly after their theatre release.
Read more >
Streamlocator Knowledge Base
Common questions and support documentation about all things StreamLocator.
Read more >
changelog-1.4 - Apache
Release Notes - Wicket - Version 1.4.18 ** Bug * WICKET-3023 - Ajax does not ... a warn or throw an exception when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found