Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Hanging SelectorManager Threads after the request has been processed on selenium grid and the driver is given the quit command. #12206

Closed
ghost opened this issue Jun 15, 2023 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 15, 2023

What happened?

On rendering a url on selenium grid, even after a session is closed and completed, the Selector manager threads in case of jdk http client and in case of default http client, AsycHttpClient threads are hanging even long after the session is closed on the grid.
Screenshot 2023-06-15 at 1 56 41 PM

How can we reproduce the issue?

public Optional<WebData> runSelenium(String domain) {
    var capabilities = Optional.of(new ChromeOptions())
        .map(options -> options.addArguments(List.of("--headless=new",
            "--disable-application-cache",
            "--disable-features=IsolateOrigins,site-per-process",
            "--no-sandbox",
            "--disable-dev-shm-usage",
            "--disable-web-security",
            "--disable-blink-features=AutomationControlled",
            "--disable-site-isolation-trials",
            "--remote-allow-origins=*",
            "--disable-popup-blocking"
        )))
        .map(options -> options.addArguments("--user,agent="
            + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0"
            + ".3945.117 Safari/537.36"))
        .map(options -> (ChromeOptions) options.setPageLoadStrategy(PageLoadStrategy.fromString("normal")))
        .map(options -> (ChromeOptions) options.setPageLoadTimeout(Duration.ofSeconds(60)))
        .map(options -> (ChromeOptions) options.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.DISMISS))
        .get();
    var url = new URL("http://localhost:4444/wd/hub");
    var driver = new RemoteWebDriver(url, capabilities, false);

    try {

      driver.switchTo().newWindow(WindowType.WINDOW);
      driver.get("http://" + "google.com");
      driver.close();

      driver.switchTo().newWindow(WindowType.WINDOW);
      driver.get("http://" + "phonepe.com");
      driver.close();
    } catch (Exception e) {

    }


    return Optional.empty();
  }

Relevant log output

.

Operating System

macOs, Debian GNU/Linux 10

Selenium version

Java 17

What are the browser(s) and version(s) where you see this issue?

Chrome 113

What are the browser driver(s) and version(s) where you see this issue?

chromedriver-113.0-grid-4.9.1-20230508

Are you using Selenium Grid?

4.9.1-20230508

@github-actions
Copy link

@b-chinmay, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Jun 15, 2023

This is a duplicate of #11826
We are having a look soon.

Copy link

github-actions bot commented Dec 9, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant