jdaugherty commented on PR #16631:
URL: https://github.com/apache/grails-core/pull/16631#issuecomment-6418642193

   @jamesfredley, I pushed dcc4f0646e over 6b3f7c9935, still a single commit on 
9.0.x. It fixes two file-handling problems:
   
   - **Records longer than a read chunk:** the command reads the capture at 
most 1 MiB per poll and dropped any line without a line end in a full chunk. 
That included valid records, such as a redacted MongoDB `$in` over 350,000 ids, 
so large commands vanished from the counts. A line that runs past a chunk is 
now carried from poll to poll until it ends. Up to 16 chunks (16 MiB by 
default) are kept whole. A longer line still counts, with its request and page, 
and its statement is cut at the limit and marked `... (cut)`. A restart drops a 
line that was still being read.
   - **Capture through a symbolic link into missing directories:** the capture 
created the directory of the link, not of the file it points to. After a clean 
build removed `build/query-tail`, opening through the link failed the start. 
The capture now creates the directories of the resolved file, where the lock 
file goes too.
   
   Tests:
   - **`QueryTailFileReaderSpec`:** a line longer than a chunk read across 
polls, a line past the limit cut with its metadata kept, a long line read once 
its writer finishes it, and a restart while a long line is pending. These 
replace the feature that expected long lines to be dropped.
   - **`QueryTailRunnerSpec`:** writes a 350,000-id `$in` through the capture 
API, followed by a small command, and checks that `--all --once --statements` 
counts both.
   - **`QueryTailCaptureSpec`:** opens a capture by its own name and through a 
link, with the target's directories missing.
   - Against the previous reader and capture, the new reader and directory 
cases fail; with the fix they pass.
   
   `:grails-datamapping-core:check` passes locally. `QueryTailCaptureSpec` also 
passes in a Linux container, as root and as a non-root user.
   


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