As promised I would report back of the result of using the workaround.

If made this code in the 'init.groovy' file based on the tips in this issue:

import jenkins.model.Jenkins
import java.util.logging.LogManager
import hudson.model.PeriodicWork
import hudson.slaves.ComputerRetentionWork

def logger = LogManager.getLogManager().getLogger("")

/* JENKINS_HOME environment variable is not reliable */
def jenkinsHome = Jenkins.instance.getRootDir().absolutePath
logger.info("RUNNING init.groovy from ${jenkinsHome}")

logger.info("--> workaround for deadlock in durable task plugin")

public class SynchronizedComputerRetentionWork extends ComputerRetentionWork {

    @Override
    protected void doRun() {
        Queue.withLock(new Runnable() {
            @Override
            public void run() {
                synchronized (Jenkins.getInstance()) {
                    SynchronizedComputerRetentionWork.super.doRun();
                }
            }
        });
    }

}

Jenkins.getInstance().getExtensionList(PeriodicWork.class).remove(ComputerRetentionWork.class);
Jenkins.getInstance().getExtensionList(PeriodicWork.class).add(new SynchronizedComputerRetentionWork());

And the result is that I have not had any deadlocks the last 24 hours

I also see that the JENKINS-27565 is fixed, so I will await a new LTS version with that bugfix included.

Thank you for your help Stephen!

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to