Open Gintasz opened 7 years ago
Might be a coincidence, but it seems to occur less when Connection: keep-alive header is removed? I remove it with Settings.builder().requestHeaders() by passing default CHROME ones but with "Connection" header removed. I'm also using a proxy.
edit: fake news
FOUND IT! I just did ~50 tries/launches with and without Connection header in main thread, separate thread, all worked 100% fine. Then I started cleaning up code, removed these lines:
Settings settings = Settings.builder()
.proxy(new ProxyConfig(ProxyConfig.Type.HTTP, "hidden", 4444, "hidden", "hidden"))
.userAgent(UserAgent.CHROME)
// .socketTimeout(15000) // this
// .connectTimeout(10000) // this
// .connectionReqTimeout(5000) // this
// .ajaxResourceTimeout(15000) // this
.build();
and it immediatelly started crashing, only 2/10 succeeded. Literally, these timeout settings somehow fix the whole problem.
P. S. I'm testing with URL "https://accounts.google.com/signin/v2"
@hollingsworthd
This has been a longstanding issue and your info provides some excellent clues as to what the root cause might be. Anyone using Apache HttpComponents coming across this page from googling should take note.
@hollingsworthd i think i found the reason for this problem. http://bugs.java.com/view_bug.do?bug_id=7003462 Here is an example how you can reproduce it.
In this Method StreamConnection.getInputStream() you got the same Inputstream twice and open it with the GZIPInputStream and i think this will be the problem with the closed Inflater. Now you have to prevent that the same Inputstream will be used twice.
@dlaske try fixing it, if it works, do a commit or post the fixed code here. I would very much appreciate it. These timeout settings of mine don't fix it 100% of the time, I still get it, but just little bit bigger success chance.
I have the same problem, even assigning the timeout values. :/
I can't pinpoint the problem, but literally, one launch it's working 100% fine 10/10 no problem, 2nd launch (no code change) I get random "Inflater has been closed" exceptions. Anyone experienced it? Would love to keep using jBrowserDriver, but I gotta fix this