-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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]: browser created but never used (same as #11881) #12832
Comments
@bhecquet, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
@bhecquet could you explain why you are setting the session request timeout to 30secs? In the rare case when the session is exactly created while the request is rejected the hub could tell the node it has already rejected the request, to allow the node to close this session instantly and not lock until the inactivity timeout is hit. The past PR did just add some extra seconds to the session request timeout. Just like setting the timeout to 35sec, so the node had some seconds more to start the session? |
Hello @joerg1985 , we have 2 hubs, for redundancy, and we do not want our session request to be stuck on one hub which eventually cannot provide session in reasonnable time. I think the case (with such low timeout) is not rare as a session creation can take 5 to 10 seconds. |
@bhecquet I think there is currently no high availability support for this in selenium itself, but this might be a cool feature. The current issue with the unused browser should be fixed in any case. |
I think the hub can be scaled up if the sessions are backed by a persistent data store. I remember even adding documentation around how to use a persistent data store for sessions here This is essentially what the distributed grid was supposed to be solving. Maybe I am missing something additional here ? |
@joerg1985 , failover is done almost the way you describe it (I added random so that we do not always pick up the same hub) @krmahadevan , we need redundancy has our grid is used for 24/24 tests, and our users don't want service to be unavailable if I need to do maintenance I've corrected the bug today, the way you proposed, and I'll provide a PR soon |
@krmahadevan the current issue is the Distributor. Needs to be backed by some sort of data storage so multiple Distributors can access the same Grid status. |
@diemol - You mean that we would need to come up with some sort of a persistant mechanism for the following in the selenium/java/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java Line 137 in e941051
|
The Grid Model |
Ok. Let me dig in and come back with what I find. |
I think long ago we did have an issue to create a Redis-backed distributor. The rationale behind it was what Diego mentioned. Then we added the Grid Model layer. So that issue was no longer valid. Maybe how we allow users to have Redis backed SessionMap, similarly, the Distributor can point to Redis-backed Grid Model or JDBC backed Grid Model. We can probably start with that. Just sharing my 2 cents. |
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. |
What happened?
Hello,
In april, I raised the issue #11881 about browser being created on selenium grid node but never used when request timeout is set.
This issue was corrected (I thought my correction was enough) but I still see the issue in an heavy loaded grid.
The point is that when requesting a new session, we do :
selenium/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java
Line 216 in 9a6947e
which waits for X secs (the session request timeout)
Then (this was the original bug), if the session is being created on node, we wait a bit more because session request is not in the queue anymore, but session may not be created when timeout expires
So, to correct it, I added an other wait of 5 seconds
selenium/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java
Line 218 in 9a6947e
These 5 seconds were arbitrary choosen but adding some logs today, I've seen that driver creation takes more time
or even more
So 5 seconds is definitely not enough
A quick solution would be to increase the time on line (e.g: 15 seconds)
selenium/java/src/org/openqa/selenium/grid/sessionqueue/local/LocalNewSessionQueue.java
Line 218 in 9a6947e
But do you think there is an other way to correct the issue ? (fixed time waits are never the best solution 😕 )
Looking at the logs (added logs can be seen here: https://github.com/bhecquet/selenium/tree/driver_sessions_staled), I think that wait time should be increased, but also, we need to prevent distributor from taking the session request once first timeout expires
How can we reproduce the issue?
Set a grid with 1 hub, 1 node and try to create 4 browsers at the time After some retries, a browser will be created without being used
Relevant log output
Operating System
Windows / Linux
Selenium version
4.13.0
What are the browser(s) and version(s) where you see this issue?
not related to browser
What are the browser driver(s) and version(s) where you see this issue?
not related to browser
Are you using Selenium Grid?
4.13.0
The text was updated successfully, but these errors were encountered: