Skip to content

Prevent Jenkins hang with unresponsive web servers#7

Open
rhayes-cida wants to merge 6 commits into
jenkinsci:masterfrom
rhayes-cida:master
Open

Prevent Jenkins hang with unresponsive web servers#7
rhayes-cida wants to merge 6 commits into
jenkinsci:masterfrom
rhayes-cida:master

Conversation

@rhayes-cida
Copy link
Copy Markdown

Existing code can stall the build if it encounters an unresponsive web server (one that allows a connection, but stalls rather than producing a response). We've had to restart Jenkins to clear the stalled builds.

This proposed change does a couple of things to prevent this problem:

  • Add a read timeout to the URL connection
  • Run the URL check in a separate thread, with a timeout when getting the response

Added call to future.cancel to try to stop the thread that's waiting for
output; however, IT DOES NOT cancel the read.

The result is that, for a badly-behaved server, each poll consumes one
thread, making it uncancellable. Not acceptable.
@buildhive
Copy link
Copy Markdown

Jenkins » sitemonitor-plugin #14 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@jenkinsadmin
Copy link
Copy Markdown
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@buildhive
Copy link
Copy Markdown

Jenkins » sitemonitor-plugin #15 FAILURE
Looks like there's a problem with this pull request
(what's this?)

Conflicts:
	pom.xml
	src/main/java/hudson/plugins/sitemonitor/SiteMonitorRecorder.java
@buildhive
Copy link
Copy Markdown

Jenkins » sitemonitor-plugin #16 SUCCESS
This pull request looks good
(what's this?)

@medington
Copy link
Copy Markdown

What is the status of this pull request? I'm running into a situation that would seem will be fixed by this. If there is something wrong with the pull request I'll be more than happy to fix it.

[JENKINS-13358] appears to be an existing issue that would relate to this pull request.

@medington
Copy link
Copy Markdown

Update: I ran into an issue with this pull request. After running the project one time, I would get an error attempting to save the project configuration after changing a setting. Restarting Jenkins seemed to work around the error but I believe there is some sort of a serialization incompatibility with this change.

I also found that patching the existing master branch with just the change to call connection.setReadTimeout also fixes the issue without restoring to using async validation of the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants