Job changed assignment while waiting for it to be closed – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.15-8.9

Briefly, this error occurs when an Elasticsearch job is reassigned to a different node while it’s in the process of being closed. This could be due to a cluster rebalancing or node failure. To resolve this issue, you can manually close the job using the close job API. If the problem persists, consider adjusting the cluster settings to prevent frequent rebalancing or check the health of your nodes to avoid unexpected failures.

This guide will help you check for common problems that cause the log ” Job [{}] changed assignment while waiting for it to be closed ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “Job [{}] changed assignment while waiting for it to be closed” classname is TransportCloseJobAction.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                        && originalPersistentTask.getAllocationId() == currentPersistentTask.getAllocationId()) {
                        return false;
                    }
                    OpenJobAction.JobParams params = (OpenJobAction.JobParams) originalPersistentTask.getParams();
                    if (movedJobs.add(params.getJobId())) {
                        logger.info("Job [{}] changed assignment while waiting for it to be closed"; params.getJobId());
                    }
                }
            }
            return true;
        }; request.getCloseTimeout(); listener.delegateFailure((l; r) -> l.onResponse(response)));

 

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?