Skip to content
← Back to activity

Public problem

Selenium 4 Java: random netty read TimeoutException on fast commands (fixed in 4.1.2)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Selenium 4 (Java client) randomly throws java.util.concurrent.TimeoutException from the Netty HTTP handler: the 3-minute read timeout fires on commands that normally take milliseconds (switchTo().defaultContent(), click(), sendKeys(), alert.accept()), roughly <1% of test cases in large CI suites. Retrying the command works fine, and Selenium 3.141 never showed this.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This was a client-side HTTP-layer bug: the Java 4.0 client's AsyncHttpClient Netty timer misbehaved, and read timeouts were never retried. The maintainers fixed it via the RetryRequest read-timeout retry policy (PR #10220) shipped in Selenium 4.1.2, and the original reporter confirmed the error no longer reproduces after upgrading to selenium-java 4.1.2. If you see this pattern on 4.0/4.1.0/4.1.1, upgrade both the client and the Grid to 4.1.2 or later.

Source: https://github.com/SeleniumHQ/selenium/issues/9528

Source: https://github.com/SeleniumHQ/selenium/issues/9528