MachinePublishers / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
809 stars 143 forks source link

Fix leaking queued instance handler thread #269

Closed tomcashman closed 7 years ago

tomcashman commented 7 years ago

We're currently using JBrowserDriver inside a tomcat instance and received the following warning when redeploying our app.

WARNING: The web application [app] appears to have started a thread named [JBrowserDriver queued instance handler] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.Object.wait(Object.java:502)
 com.machinepublishers.jbrowserdriver.JBrowserDriver$1.run(JBrowserDriver.java:220)
 java.lang.Thread.run(Thread.java:745)

I have implemented a fix that will start/stop this thread as required which removed this error in our logs.

hollingsworthd commented 7 years ago

Interesting. I would have thought Tomcat wouldn't complain for daemon threads. Thanks for contributing this! Looks good.