Skip to content

[πŸ› Bug]: When encounter an exception in RemoteWebDriverBuilder.build(), the underlaying HttpClient resources are not releasedΒ #15710

@jacklee1983

Description

@jacklee1983

Description

var webDriver = RemoteWebDriver.builder().address(REMOTE_URL).build()
In the above code when there is an exception in the build() method, no webDriver instance returned and I cannot release the underlaying HttpClient resources. Could we consider releasing the HttpClient resources inside the build() before throwing an exception?
The exception example :

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: java.io.IOException: Proxy-Authenticate header missing for response code 407
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
at org.openqa.selenium.remote.RemoteWebDriverBuilder.getRemoteDriver(RemoteWebDriverBuilder.java:394)
at org.openqa.selenium.remote.RemoteWebDriverBuilder.build(RemoteWebDriverBuilder.java:366)

Reproducible Code

var webDriver = RemoteWebDriver.builder().address(REMOTE_URL).build()

Debugging Logs

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: java.io.IOException: Proxy-Authenticate header missing for response code 407 
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
	at org.openqa.selenium.remote.RemoteWebDriverBuilder.getRemoteDriver(RemoteWebDriverBuilder.java:394)
	at org.openqa.selenium.remote.RemoteWebDriverBuilder.build(RemoteWebDriverBuilder.java:366)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaJava BindingsI-defectSomething is not working as intendedJ-awaiting answerQuestion asked of user; a reply moves it to triage againOS-linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions