-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Selenium Gird Scaler | Edge active sessions not being properly counted #2709
Comments
Testing this a bit further and it seems that this limits the scale-up as well. For example, take this testing scenario:
What we would expect to happen here is that we would scale up to 15 pods in order to allow the 5 tests in the queue to start. In actuality, nothing happens. I believe this is also because of the edge sessions having a different browserName when they are in an active session. Keda knows there are 10 pods up but does not see any active sessions under the name "MicrosoftEdge" so it assumes the sessions in the queue will be picked up soon and thus does not scale. |
Hi, Maybe I'm missing something but I think that if we apply that patch and then the upstream uses the same name in both cases, KEDA will fail again. thoughts @kedacore/keda-core-contributors ? |
@JorTurFer After talking with some contributors for selenium it seems that the edgeDriver accepts a few values as valid (having trouble finding any sort of a list though) when starting but will in the end self identify as 'msedge' every time: It would seem in this case that the driver session would never report anything other than "msedge". Modifying my session call to appear as "msedge" gets it in the session queue but my current hurdle is getting the Edge node to accept the "msedge" browserName stereotype as something to pick up on the node. Still working on this so there may be a way to get this working as-is. Even though this is an upstream responsibility I think a small modification in one/two file(s) here would be much simpler than large code changes across multiple projects and tools. Perhaps this could be an optional parameter such as |
I agree with that optional parameter. Maybe explaining it well in the docs we could fill the gap and don't be attached to future changes in their side because it's just remove the value for the optional parameter (but this edge case should be documented IMO) |
@JorTurFer Is there a tag needed for this to be discussed or have someone chime in? |
An optional parameter seems like the best solution for this, together with a proper documentation. Anyone up for a contribution? |
@zroubalik I have some time so taking a stab at this now. |
I have a working solution for this but ran into a bit of a snag: #3061 Going to see about fixing that as well in this as it should be fairly simple. |
Signed-off-by: Brandon Wolfe <Wolfe1@gmail.com>
Report
Been working on getting a selenium grid 4 deployment working in AKS using Keda to scale. Chrome and Firefox have been no problem but scaling Edge browser pods seems to have a bug.
Currently using the following scaled-object:
New sessions in the queue appear as 'MicrosoftEdge' and scale up just fine:
However, taking a look at the active sessions I noticed that the browserName on the active sessions becomes 'msedge':
Thus when it comes time for Keda to check for a scale-down event it sees that there are no active sessions and proceeds scale to 0.
Expected Behavior
Keda detects that Edge pods are still in use and scales down gradually as needed.
Actual Behavior
When scaling down Keda will remove all Edge pods regardless of current active sessions.
Steps to Reproduce the Problem
Logs from KEDA operator
KEDA Version
2.6.1
Kubernetes Version
1.21
Platform
Microsoft Azure
Scaler Details
Selenium Grid
Anything else?
I am not in any way familiar with Go and am having issues deploying a local change to AKS but I believe all that really needs done here is a specific check for "MicrosoftEdge" as a browserName and then simply use the session-specific naming of 'msedge' in that situation.
Probably something like this (though im sure there is a more elegant way to put it). Around line 225 in selenium_grid_scaler:
The text was updated successfully, but these errors were encountered: