davsclaus opened a new pull request, #30028:
URL: https://github.com/apache/camel/pull/30028

   JIRA: [CAMEL-26929](https://issues.apache.org/jira/browse/CAMEL-26929), item 
6.
   
   ## The problem
   
   While tracing is on, `FileCliConnectorTransport` appends the new traces to 
`~/.camel/<pid>-trace.json`, and nothing ever trims the file: 758 KB after ten 
minutes of a 2 s timer, and about 15 MB a minute at 100 exchanges/s. `camel 
trace --tail` reads it whole every time.
   
   ## The change
   
   - **Connector:** when the next write would take the file past 10 MB 
(`MAX_TRACE_FILE_SIZE`), the file is deleted and the traces start a new one. A 
single snapshot larger than that is still written to an empty file.
   - **`camel trace` (follow):** a file that got smaller than when it was last 
read is a new file, so the reader reopens it and reads it from its start. 
Before, the open reader stayed on the deleted file.
   - **TUI trace view:** read from position 0 when the file is shorter than the 
position read so far. Before, `length <= lastPos` returned early, so the view 
never read the file again.
   
   An older CLI or TUI that follows the file of a newer integration stops 
seeing new traces after the first new file, until it is started again. That 
only happens after 10 MB of traces.
   
   ## Tests and docs
   
   - `TraceFileSizeTest` (connector): a full file starts again, a file with 
room is appended to, and an empty file takes data larger than the maximum.
   - `CamelTraceActionTest.aTraceFileThatGotSmallerIsANewFile` and 
`DataRefreshMembershipTest.aTraceFileThatGotSmallerIsReadFromItsStart`.
   - Connector suite green (127 tests).
   - `cli-connector.adoc` describes the trace file; the catalog copy is updated.
   
   Not checked end to end: it needs 10 MB of traces.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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