David on Nostr: Just a wild guess but could a race condition between a subtask marking itself ...
Just a wild guess but could a race condition between a subtask marking itself complete and your “supervisor” process that checks if no subtasks are incomplete.
So when subtask 3 for example marks itself complete if your “supervisor” checks before your subtask 4 is added it would see all subtasks complete. A bandaid could be only marking a subtask complete after the next subtask is inserted.
Sounds like you’re using a DB to track the jobs. Is that because your workers are distributed?
Published at
2024-09-05 12:21:09Event JSON
{
"id": "3e2da761a295f7eb59449d6d62617e0623c39ce04f68d281c611fe7f4f14f186",
"pubkey": "de279ef2777cca0252b0865ec1bf5375f32122fcda65fdf223a5788718f105ff",
"created_at": 1725538869,
"kind": 1,
"tags": [
[
"e",
"2bc766a600e58bcec8501c24e0d7d2dedaae35a5cca9b3972fe7f968180ec315",
"",
"root"
],
[
"e",
"05a3f76105284de36b52cc1ece6df74831491dda9a0755097fec9aa581e32655",
"",
"reply"
],
[
"p",
"454bc2771a69e30843d0fccfde6e105ff3edc5c6739983ef61042633e4a9561a"
]
],
"content": "Just a wild guess but could a race condition between a subtask marking itself complete and your “supervisor” process that checks if no subtasks are incomplete.\n\nSo when subtask 3 for example marks itself complete if your “supervisor” checks before your subtask 4 is added it would see all subtasks complete. A bandaid could be only marking a subtask complete after the next subtask is inserted.\n\nSounds like you’re using a DB to track the jobs. Is that because your workers are distributed?",
"sig": "7ea4668e3a49a0049f79997ac987e7acf971d9237830e07efe36e6661ffa08e59257518c1030f454fa635c4c476a9cbccf343cc8664da40cd6f3c7902dd05e37"
}