-
Notifications
You must be signed in to change notification settings - Fork 18
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
isAgentConnected is not reliable #3
Comments
Actually, I just noticed the function |
Hi. I've noticed situations where the agent connects and then disconnects few seconds after. Could you verify and let me know please? |
Hi @lucanaldini . Yes, this is the version that we use. Independently of the bug, the piece of code is still built on wrong assumptions. Regards. |
Hi, thanks for checking. Line 439 is checking that the last 37 characters of the console output contains "successfully connected and online". In your output that wouldn't be the case (since you have that stacktrace at the end). So It might be that the agent disconnected after being connected at least 10 seconds. |
Hi,
The function to detect if an agent is connected makes wrong assumptions.
On line 439 we see that it checks for the string
"successfully connected and online"
.However, we currently have an offline node and when accessing the corresponding page, it prints:
I believe this happens when a node was successfully online but then Jenkins lost the connection later on. It just appends to the previous message.
A clean alternative would be to access
"/computer/"+buildBox+"/api/json"
instead and check for theoffline
key (boolean).Best regards!
The text was updated successfully, but these errors were encountered: