Dhairya-007 commented on PR #29680:
URL: https://github.com/apache/camel/pull/29680#issuecomment-6820251844
Thanks both. All three points applied.
**Log volume — you're right, and I had it backwards.** A full queue *is* the
burst, so one WARN per lost event is worst-case behaviour: thousands of
identical lines, and the extra log I/O while the polling threads are already
behind makes the backlog worse. The `OVERFLOW` warning above is not a
precedent, because the watch service emits that once per overflow and not once
per file. I took your version almost verbatim:
```java
if (queueFullWarned.compareAndSet(false, true)) {
LOG.warn("The event queue is full at its configured size of {}, so file
events are dropped (first: {} {})."
+ " Consider increasing the option 'queueSize'. Further dropped
events are logged at DEBUG level.",
getEndpoint().getQueueSize(), fileEvent.getEventType(),
fileEvent.getEventPath());
} else {
LOG.debug("Dropping {} event for {}: the event queue is full", ...);
}
```
and reset the flag in `doStart()` as you suggested, so a restarted consumer
warns again. Every drop is still reported through the return value — the test
now offers a third event to cover the DEBUG branch.
**`queueSize` description.** Added, and propagated by hand since I cannot
run maven here: `FileWatchEndpoint` and `FileWatchComponent`, both entries in
`components/camel-file-watch/src/generated/resources/.../file-watch.json`, both
in the `camel-catalog` copy, and the Javadoc in
`FileWatchEndpointBuilderFactory` (2 blocks) and
`FileWatchComponentBuilderFactory` (1 block). For the DSL builders I ported the
generator's wrap (69 characters of text at indent 9) and checked it reproduces
the *existing* two lines byte-for-byte before re-wrapping, so only the second
line moves. The two JSON copies are asserted identical after the edit. If the
regen job still finds a difference I will take its patch.
**`shouldQueueEveryEventWhenUnbounded`** — dropped, you're right that it
tested `LinkedBlockingQueue` rather than this code.
**JIRA** — I do not have credentials for issues.apache.org from this
environment, so I cannot open the ticket. If you want a `CAMEL-XXXX` on this,
could a committer create it (or give me the number) and I will retitle the PR
and amend the commit message?
--
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]