title: java.net.SocketException: Connection reset on Selenium driver.close() or driver.quit() statements
body: <p>I am seeing a <em>java.net.SocketException: Connection reset</em> almost every time I use a driver.close() or driver.quit() statement. The browser does get closed and the exception isn't affecting any of my tests so far, but I would still like to understand why this is happening.</p>
  <p>I checked for a version incompatibility, but the issue persists even after I updated my ChromeDriver. (I'm using ChromeDriver 84.0.4147.30 with Google Chrome Version 84.0.4147.105.)</p>
  <p>The issue is intermittent, but usually occurs about 80% of the time.</p>
  <p>Code:</p>
  <pre><code>public static void main(String[] args) {
          System.setProperty(&quot;webdriver.chrome.driver&quot;,&quot;/chromedriver.exe&quot;);
          WebDriver driver = new ChromeDriver();
          driver.get(&quot;https://www.google.com/&quot;);
          driver.close();
          System.exit(0);
      }
  </code></pre>
  <p>Error:</p>
  <pre><code>SLF4J: Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;.
  SLF4J: Defaulting to no-operation (NOP) logger implementation
  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
  Starting ChromeDriver 84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310}) on port 24445
  Only local connections are allowed.
  Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
  ChromeDriver was started successfully.
  Aug 07, 2020 6:39:11 PM org.openqa.selenium.remote.ProtocolHandshake createSession
  INFO: Detected dialect: W3C
  Aug 07, 2020 6:39:14 PM org.openqa.selenium.remote.http.WebSocket$Listener onError
  WARNING: Connection reset
  java.net.SocketException: Connection reset
      at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:345)
      at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:376)
      at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
      at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133)
      at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
      at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
      at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
      at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
      at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.base/java.lang.Thread.run(Thread.java:832)
  
  
  Process finished with exit code 0
  </code></pre>