[FIX] avoid UnreachableBrowserException when creating WebDriver instance#14
Closed
curva wants to merge 1 commit intoSeleniumHQ:masterfrom
curva:circular_redirect_exception_spike
Closed
[FIX] avoid UnreachableBrowserException when creating WebDriver instance#14curva wants to merge 1 commit intoSeleniumHQ:masterfrom curva:circular_redirect_exception_spike
curva wants to merge 1 commit intoSeleniumHQ:masterfrom
curva:circular_redirect_exception_spike
Conversation
…end() method flushes response to tcp stream.
Member
|
Have you signed the project CLA? It's at https://spreadsheets.google.com/spreadsheet/viewform?hl=en_US&formkey=dFFjXzBzM1VwekFlOWFWMjFFRjJMRFE6MQ#gid=0 |
Contributor
|
It was fixed by similar code at revision 2f2cdf3 |
IlyaNaumovich
added a commit
to IlyaNaumovich/selenium
that referenced
this pull request
Feb 11, 2018
yiming-tang-cs
pushed a commit
to ponder-lab/selenium
that referenced
this pull request
Jan 2, 2020
yiming-tang-cs
pushed a commit
to ponder-lab/selenium
that referenced
this pull request
Jan 2, 2020
SeleniumHQ#14: reply with notify_close even if "we are a client"
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Avoid multiple call for org.webbitserver.HttpResponse#end(), which flushes http response to tcp stream in rare cases. This causes UnreachableBrowserException when creating WebDriver instance (see exception message below [*1]).
Detail:
When a test code creates WebDriver instance, WebDriver(client) sends new session request. If WebDriver(server) receives that request, server renders response using RedirectResult#render() and flushes it using WebbitHttpResponse#end().
But there's a issue that WebbitHttpResponse#end() is called two times (see below[*2]).
WebbitHttpResponse#end() calls Webbit's NettyHttpResponse#end() that flushes http response to tcp stream. So WebDriver client gets same response two times as described below:
If WebDriver client gets redirect response two times, a CircularRedirectException will be thrown by apache http client which results in UnreachableBrowserException.
That's why WebbitHttpResponse should call webbit's HttpResponse#end() just one time.
Remarks:
(*1) UnreachableBrowserException Stacktrace
(*2) Caller of WebbitHttpResponse#end()
first one is:
second one is either of them below:
-> org.openqa.selenium.remote.server.WebbitHttpResponse#sendRedirect()
Reproduction Code: