I have been looking into this as we also get spammed each time we restart Jenkins.
During a Jenkins restart there is one email sent for the shutdown of the slave at the restart, and then another email when the slave is launched again when Jenkins has started.
I have managed to stop the mails sent when Jenkins is terminating (see this commit) but not when Jenkins is starting again. One idea I had was to check the init level, and if it's not COMPLETED no emails should be sent. The starting of the slaves however happen in a later step, so the init level will already be COMPLETE.
Jenkins.getInstance().getInitLevel() == InitMilestone.COMPLETED
I have run out of ideas so any suggestions are welcome...
I have been looking into this as we also get spammed each time we restart Jenkins.
During a Jenkins restart there is one email sent for the shutdown of the slave at the restart, and then another email when the slave is launched again when Jenkins has started.
I have managed to stop the mails sent when Jenkins is terminating (see this commit) but not when Jenkins is starting again. One idea I had was to check the init level, and if it's not COMPLETED no emails should be sent. The starting of the slaves however happen in a later step, so the init level will already be COMPLETE.
I have run out of ideas so any suggestions are welcome...