Skip to content

Commit c45038c

Browse files
authored
Improve task removal assertion message (#94596)
An assertion exists to ensure if a task to be removed was actually pending removal. This commit improves the assertion message to contain the entire task string representation like action/etc, instead of just the task id.
1 parent 063fd6d commit c45038c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/tasks/TaskManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ Set<CancellableTask> drainTasks() {
744744

745745
void removeTask(CancellableTask task) {
746746
final boolean removed = pendingTasks.remove(task);
747-
assert removed : "task " + task.getId() + " is not in the pending list";
747+
assert removed : "task is not in the pending list: " + task;
748748
}
749749
}
750750

0 commit comments

Comments
 (0)