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

   Thanks Claus, agreed. Done in fcf3f98839ad:
   
   1. A `VirtualMachineError` in the shard monitor is now logged at ERROR and 
goes to `handleFatalError(e)`, like the SQS visibility extender. The consumer 
stops consuming until the route is restarted, and its health check is DOWN with 
`getFatalError()`. Any other `Error` (and an `Exception`) is still a failed run 
at WARN, in one `catch (Exception | Error e)` as you suggested.
   2. Throw or return: I kept `throw e`. It ends the scheduled task, which is 
what we want here: the consumer no longer polls (`isRunAllowed()` is false), so 
more `ListShards` calls against the stream only cost API calls, and a stop and 
start schedules a new monitor anyway. SQS gets the same effect with `cancel()` 
plus `return`; here the throw is the cancel, and nothing is lost because the 
error is logged and kept as the fatal error.
   3. `aVirtualMachineErrorStopsOnlyTheMonitor` is replaced by 
`aVirtualMachineErrorStopsTheConsumerUntilRestarted`: readiness is DOWN with 
`consumer.getFatalError()` being the error, the next `run()` does not poll (no 
new `GetRecords`), and a stop and start clears the fatal error, lists the 
shards again and reads them (the children from `TRIM_HORIZON`). It fails on the 
previous head (`getFatalError()` is null), and passes 10 of 10 runs. The 
kinesis unit tests pass (85 plus the 1000 DST seeds), built with the core 
modules of main in the same reactor.
   4. #30840 is not merged yet, so there is no `shardListError` on this branch 
to set. Whichever of the two merges second will set it in the `Error` catch too 
(with the field a `Throwable`). I noted that in the description.
   


-- 
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