Task state logs and data fix #4206
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm putting this in on top of @fjetter's fix in #4200 to try to track down the assertion errors in the
task_validatethat showed up in CI.I can reproduce that failure locally one out of every 10 times or so, running
pytest test_failed_workers.py::test_worker_who_has_clears_after_failed_connection -sTo try to track down what was happening, I've added in per-task logs.
What I found from there is that @fjetter is almost certainly correct that there's an extra
release_keycall somewhere.The failure occurs consistently for me where the only task-level log entry is "new", indicating a newly created
TaskStateobject, but the same key already exists inself.data, which would indicate that we've calledrelease_keybut that because there aredependentsof that particular task, we don't clear out the entry inself.data.I've "fixed" that here by just nuking the key if it's present in
self.data, but I don't think that's the correct way to fix this. I'm putting this up in case anyone else can make use of the task-level logs (and I'll also keep looking for the stray call)