egor-ryashin commented on a change in pull request #7038: Fix and document
concurrency of EventReceiverFirehose and TimedShutoffFirehose; Refine
concurrency specification of Firehose
URL: https://github.com/apache/incubator-druid/pull/7038#discussion_r260972054
##########
File path:
server/src/main/java/org/apache/druid/segment/realtime/firehose/EventReceiverFirehoseFactory.java
##########
@@ -280,52 +294,36 @@ private Thread createDelayedCloseExecutor()
// The closed = true is visible after close() because there is a
happens-before edge between
// delayedCloseExecutor.interrupt() call in close() and catching
InterruptedException below in this loop.
while (!closed) {
- Long closeTimeNs = null;
- Boolean dueToShutdownRequest = null;
+ // Reading idleCloseTimeNs and requestedShutdownTimeNs to locals
for absolute confidence that there
+ // couldn't be NPE in comparisons with nanoTime() below.
Review comment:
I don't see any place where _idleCloseTimeNs/requestedShutdownTimeNs_ can be
set to null after it was initialized. So if you check it for `!= null` it stays
that way always, meaning I don't understand why additional locals are used.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]