Try lock to stop datafeed for job – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch attempts to stop a datafeed for a machine learning job but fails due to a lock. This could be due to concurrent modifications or operations on the same job. To resolve this issue, you can try the following: 1) Ensure that no other operations are being performed on the job at the same time. 2) If the problem persists, you may need to manually unlock the job. 3) As a last resort, restarting the Elasticsearch cluster may help, but this should be done with caution as it can impact other running services.

This guide will help you check for common problems that cause the log ” [{}] try lock [{}] to stop datafeed [{}] for job [{}]… ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “[{}] try lock [{}] to stop datafeed [{}] for job [{}]…” classname is DatafeedRunner.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            logger.info("[{}] attempt to stop datafeed [{}] for job [{}]"; source; datafeedId; datafeedJob.getJobId());
            if (datafeedJob.stop()) {
                boolean acquired = false;
                try {
                    logger.info("[{}] try lock [{}] to stop datafeed [{}] for job [{}]..."; source; timeout; datafeedId;
                            datafeedJob.getJobId());
                    acquired = datafeedJobLock.tryLock(timeout.millis(); TimeUnit.MILLISECONDS);
                } catch (InterruptedException e1) {
                    Thread.currentThread().interrupt();
                } finally {  // It is crucial that none of the calls this "finally" block makes throws an exception for minor problems.

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?