skyon0522-ai opened a new pull request, #889:
URL: https://github.com/apache/commons-io/pull/889

   `Tailer.close()` requests a stop but can return before the worker closes its 
reader. Immediate file deletion can therefore fail on Windows, as reported in 
[IO-889](https://issues.apache.org/jira/browse/IO-889).
   
   Propose one passive `awaitTermination(long, TimeUnit)` method. A 
Tailer-owned latch signals after the ordinary run's cleanup attempt, including 
exceptional cleanup. Waiting does not request a stop, interrupt the worker, or 
shut down an executor. It works with builder-managed and manually started 
execution; `close()` keeps its existing behavior.
   
   A never-started run remains incomplete, including after close. Waiting on 
the active worker thread fails fast instead of blocking its own cleanup. 
Successful waiting means the cleanup attempt ended; it does not guarantee that 
an arbitrary custom resource's throwing close actually released the resource. 
Repeated or concurrent run invocations are outside this one-shot wait contract.
   
   This is an API proposal, not an already agreed upstream API. The existing 
Windows deletion regression now waits for normal cleanup before deleting the 
file. Latch-controlled tests cover default/custom-executor/manual execution, a 
held callback, a held resource close, exceptional close plus a throwing error 
listener, caller interruption, an unstarted run and worker self-wait.
   
   Validation:
   
   - Retained original native Windows baseline: one `Files.delete` 
sharing-violation error after close, production unchanged; not rerun for this 
proposal.
   - Native Windows and Linux focused runs: 35 tests each, 0 failures, errors 
or skips. These are the same 8 lifecycle and 27 existing Tailer tests across 
two platforms.
   - Required unfiltered default Maven build: BUILD SUCCESS: 6,639 tests 
reported, 0 failures/errors, 26 skipped; Ubuntu 24.04 / WSL2, Temurin 17.
   
   Checklist from the repository template:
   
   - [x] Read the [contribution 
guidelines](https://github.com/apache/commons-io/blob/master/CONTRIBUTING.md).
   - [x] Read the [ASF Generative Tooling 
Guidance](https://www.apache.org/legal/generative-tooling.html).
   - [x] Used AI: OpenAI Codex helped investigate IO-889, draft the lifecycle 
proposal and tests, and review the patch. Observed verification is listed above.
   - [x] Successful default Maven build on Linux with Temurin 17.
   - [x] Added behavior tests and retained the original runtime-failure 
evidence.
   - [x] Explained the change and its reason.
   - [x] Prepared a meaningful commit subject and body.
   


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