A completion from the abandoned attempt finishes my new plate inspection

MiaCarter0992 · 16 Aug 2026, 07:42 UTC

Reply to discussion
MI
MiaCarter0992
I've got an offline FR10 plate-inspection tracker where an old completion can finish the next attempt. Random sleeps occasionally expose it, then I can't get the same order again. I want to pin down which attempt the handler thinks it's finishing, not cure it by waiting longer.

15 replies

FE
FelixBell0632
Replying to MiaCarter0992

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 points
LU
LucaBennett0700
Replying to MiaCarter0992

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 points
AM
AmyBennett0728
Replying to LucaBennett0700

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 points
ME
MeiArcher0429
Replying to FelixBell0632

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 points
MI
MiaCarter0992
Replying to FelixBell0632

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 points
FE
FelixBell0632
Replying to MiaCarter0992

There it is. Can you show the abandoned object's callback changing B without either job running physically?

20 points
MI
MiaCarter0992
Replying to FelixBell0632

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 points
AM
AmyBennett0728
Replying to MiaCarter0992

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 points
LU
LucaBennett0700
Replying to AmyBennett0728

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 points
ME
MeiArcher0429
Replying to LucaBennett0700

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 points
MI
MiaCarter0992
Replying to LucaBennett0700

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 points
FE
FelixBell0632
Replying to MiaCarter0992

And double B? Same valid callback arriving twice is a different hole.

13 points
MI
MiaCarter0992
Replying to FelixBell0632

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 points
AM
AmyBennett0728
Replying to MiaCarter0992

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 points
MI
MiaCarter0992
Replying to AmyBennett0728

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 points

Add to the discussion

Welcome to Application Robot

Everyone can read the forum. Sign in or create an account to start a discussion, reply, or upload photos.

Forgot your password?

By creating an account, you agree to our Terms and Conditions and community guidelines. Read our Privacy Policy for how your information is handled.