allthingssecurity commented on PR #30465:
URL: https://github.com/apache/camel/pull/30465#issuecomment-7034163930
Thanks for the review. All four points are in cfd1d2e (a follow-up commit,
no force push).
1. Counter reset on open: fixed as you suggested. `scanRecovered()` holds
the INFO and the reset. It runs when a line is read, or a non-empty read in raw
mode, and no longer when the stream opens. Raw mode had the same hole in a
worse form: a read that failed was ignored and the stream was opened again
right away. Raw mode now reports it and ends the stream, as line mode does.
New tests, with the server answering the same way on every request:
- `testConnectionLostOnEveryRequest` and its raw variant: a 200 whose
connection is reset before any body. The exception handler gets exactly one
failure, and each request comes at least 900 ms after the one before.
- `testConnectionLostAfterDataOnEveryRequest`: your `a\n|cut` case. Each
line is routed, and each request comes at least 900 ms after the one before.
One thing to be aware of: in the `a\n|cut` case a line is read every
time, so every cut counts as a new first failure and goes to the handler, at
most once a second. I kept it that way because a line was really read. Say if
you would rather count failures differently.
Against the previous head of this PR, these fail:
- line mode: 3 handler calls, and the next request came about 200 ms
later;
- raw mode: 0 handler calls;
- the `a\n|cut` case: 205 ms between requests.
2. Back-to-back request: fixed. A failure sets a flag that skips the re-open
in the same loop iteration, so the stream is opened again only after the sleep
(at least 1 s). `testServerNotAvailableWhenStarted` now checks that the second
request comes at least 900 ms after the failed first one. On the previous head
it came 0 ms after.
An internal review of this commit found one more case: with
`retry=false`, a failed stream is never opened again, and once the flag was
cleared the loop slept `scanStreamDelay` (0 by default) per round. The 1 s
floor now also stays while a failure is not followed by data and `retry` is off.
3. Docs: one paragraph in `stream-component.adoc` after the
`retry`/`fileWatcher` example, with the catalog copy (identical), and a
`camel-stream` entry in the 4.24 upgrade guide.
4. `stopServer()` now stops the context before it closes the server.
Runs: camel-stream tests 40 run, 0 failures (1 skipped, as on main);
`StreamHttpScanRetryTest` 20 times in one JVM, 140 of 140.
_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]