Code changed in jenkins
User: James Nord
Path:
src/main/java/hudson/plugins/build_timeout/BuildTimeoutWrapper.java
http://jenkins-ci.org/commit/build-timeout-plugin/ee18187343060a92a931e749815dd80abc1752d3
Log:
[FIXED JENKINS-31627] canceld TimerTasks should be purged.
The TimerTask could be way off into the future as it is user input that
decides when this is run (and or jobs running multiple days the inactivity
could be 1 day). Without purging the Timer the TimerTasks stay into the
queue until such time that they are the next task to run - at which time
they are removed. But with all other triggers in a system (polling every
minute etc) added timers could stay for their maximum duration.
For arguments sake say this is 1 day and you have a build that produces
10000 lines of output every 10 hours and uses the NoActivity strategy.
In this case for every call to write you will have a new TimerTask created
that should trigger in 24hours time - it is easy to see these 10000
TimerTasks are referenced from the Timer and as such will not be garbaged
collected for a long while.
If you have lots of these styles of jobs - the required heap to run this
becomes massive.
NoActivityTimeOutStrategy.onWrite() calls BuildTimeoutWrapper.rescheduleIfNeeded() which will in this case cause a rescheduling.