allthingssecurity commented on PR #29995:
URL: https://github.com/apache/camel/pull/29995#issuecomment-6894225249

   Thanks @davsclaus. Pushed 80a2391b8822 on top of your rebase:
   
   1. **Fetch holds a partial batch**: done along your sketch. I checked it 
against jnats 2.26.4 (`javap -c` of `NatsJetStreamPullSubscription._fetch` and 
`PullMessageManager.manageStatus`): one pull with `expiresIn`, a loop while 
`batchLeft > 0 && timeLeft > 0`, a terminus status returns what it has, an 
error status throws `JetStreamStatusException`. The fake fetch now waits until 
the timeout, `availableCount(startSeq) >= batch`, the consumer is deleted or 
the subscription is inactive, and sets `redeliverAt = Math.max(fetchStart, 
m.availableSince) + ackWait`. `availableSince` is set at publish, when AckWait 
or a nak releases a message (the end of the nak delay for a delayed nak), and 
when a new ephemeral consumer makes a message available again. The [P] Javadoc 
and the timing paragraph say this.
      Re-run: 5000 of 5000 seeds pass on main (no new failing seed to triage). 
Self-check with 6bc46f9cffc1 (CAMEL-26884) reverted: 339 of 2000 seeds fail, 
all on "a stopped consumer leaves no subscription active" (346 before; the seed 
stream changed with the new draws).
   2. **Message after the faults cleared**: done. The `-2` step of the finisher 
publishes an `end` message, and the world passes only if it ends ACKED, so a 
fetch loop that ended is caught.
   3. **Realistic fetch failure**: the injected fault is now a fetch while the 
connection is down: no message comes and the fetch ends empty at its timeout. I 
did not add a `JetStreamStatusException` fault. In 2.26.4 the only 409s that 
`manageStatus` reports as errors are Consumer Deleted, which the deletion 
already drives, and "Consumer is push based", which needs the consumer 
reconfigured as push. So the `else` branch of that catch stays undriven, and 
`IllegalArgumentException` is gone.
   4. **Server Shutdown vs Consumer Deleted**: done. When the ephemeral 
consumers are deleted, the seed picks per event whether a waiting fetch sees 
409 Server Shutdown (a warning: it keeps waiting and returns at its timeout the 
messages it got before) or 409 Consumer Deleted (the fetch throws). With Server 
Shutdown the next fetch gets the 503 and the consumer reaches `getConsumerInfo` 
from there.
   5. Agreed as a follow-up: once #29998 is merged, an operator step that stops 
and starts the route's consumer itself (`ServiceHelper.stopService` + 
`startService`, sometimes right after a start) would let the world fail on the 
code before #29998.
   6. **Invariant name**: done; the `dst.check` name now ends with "(or skipped 
by a consumer made again after its ack was lost)", as in `@DstWorld`.
   
   The faults list of `@DstWorld` changed with 3 and 4, so the component JSON 
and its catalog copy are regenerated (byte-identical); the doc table only lists 
covers and issues, which did not change.
   
   _Claude Code on behalf of allthingssecurity_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to