You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/07/01 12:40:51 UTC

[I] StreamPollFeeder.done should be volatile (thread may hang) [maven-shared-utils]

elharo opened a new issue, #385:
URL: https://github.com/apache/maven-shared-utils/issues/385

   `StreamPollFeeder.done` (line 40) is not declared `volatile`, but is read in `run()` outside any `synchronized` block (line 61) while being written in `waitUntilDone()` inside `synchronized (lock)` (line 107).
   
   When the `run()` thread is actively reading data (`input.available() > 0` is continuously true), it never enters the `synchronized (lock)` block where the lock's happens-before would provide visibility. So `waitUntilDone()` setting `done = true` may never be seen by the `run()` thread, causing it to loop forever — and `waitUntilDone()`'s subsequent `join()` call hangs too.
   
   Fix: declare `done` as `volatile`.


-- 
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: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] StreamPollFeeder.done should be volatile (thread may hang) [maven-shared-utils]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo closed issue #385: StreamPollFeeder.done should be volatile (thread may hang)
URL: https://github.com/apache/maven-shared-utils/issues/385


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org