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:41:08 UTC
[I] StreamPollFeeder.exception should be volatile [maven-shared-utils]
elharo opened a new issue, #386:
URL: https://github.com/apache/maven-shared-utils/issues/386
`StreamPollFeeder.exception` (line 38) is not declared `volatile`, but is written by the `run()` thread (line 79) and read from other threads via `getException()` (line 101). While `waitUntilDone()` calls `join()` which establishes a happens-before for reads that happen after the thread terminates, if `getException()` is called concurrently from another thread before `waitUntilDone()`, the read may see stale `null`.
`StreamPumper` already uses `volatile` for its `exception` field (line 41). `StreamPollFeeder` should follow the same pattern for consistency and correctness.
Fix: declare `exception` 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.exception should be volatile [maven-shared-utils]
Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo closed issue #386: StreamPollFeeder.exception should be volatile
URL: https://github.com/apache/maven-shared-utils/issues/386
--
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