A completion from the abandoned attempt finishes my new plate inspection
MiaCarter0992 · 2026年8月16日 07:42 UTC
主帖中文翻译暂不可用,以下显示英文原文;回复保留原文。 查看英文原文
15 条回复
What exactly reaches the handler: an event tied to an attempt, or just complete? Need to know what information you're throwing away, if any.
13分Replace the sleeps with a queue you release by hand. Start A, abandon A, start B, deliver A's completion. No timing lottery needed for that sequence.
3分I like Luca's queue, but don't quietly give the fake messages an identity the real interface hasn't promised. You can label them in the test harness to explain their origin without pretending your application can read that label.
4分Log handler input and chosen attempt separately. A neat event log won't expose the bug if the log itself uses whichever attempt is current.
9分The offline jobs already have attempt objects. The callback closes over a shared current-attempt variable instead of the object that scheduled it. So the information exists, then my handler looks elsewhere.
5分There it is. Can you show the abandoned object's callback changing B without either job running physically?
20分Yes, queued that sequence and B switches to finished as soon as I release A's callback. No controller involved. Mei was right too, the old log printed B's name and disguised where it came from.
7分That's a properly annoying log. I'd keep the origin in it even after fixing the callback, because otherwise the first duplicate you investigate will look like a fresh completion again. Does abandoning A leave its queued callback alive deliberately, or is cancellation failing as well?
7分Cancellation can be a separate issue. The handler should still refuse an obsolete completion if it arrives after cancellation was requested; don't make the test disappear just by emptying the queue.
16分Also release A twice in the test, then B. You want one accepted completion for B, not merely a screen that ends up looking right.
9分Changed the callback to retain its originating attempt and check whether that attempt is still eligible. Old A is now recorded as ignored; B stays pending until its own callback. The double-A case leaves B's accepted count at zero.
3分And double B? Same valid callback arriving twice is a different hole.
13分Caught that one. My first change accepted B twice. Added an already-completed check, and the second B callback now leaves the accepted count alone.
17分Thanks for testing it instead of just saying the guard should cover it. I was wondering whether your count and the visible state shared that rule.
10分They do now. Saved deterministic tests cover obsolete A, repeated A, valid B and repeated B, with state and accepted count checked independently. That's the offline tracker bug fixed; I haven't inferred anything about live controller event identity from it.
2分