pnowojski commented on a change in pull request #8124: [FLINK-11877] Implement
the runtime handling of the InputSelectable interface
URL: https://github.com/apache/flink/pull/8124#discussion_r276288402
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java
##########
@@ -184,6 +184,9 @@
/** A timer to retrigger local partition requests. Only initialized if
actually needed. */
private Timer retriggerLocalRequestTimer;
+ /** Flag indicating whether there is available data. */
+ private volatile boolean moreDataAvailable = false;
Review comment:
(**hot looping without synchronisation part 1**) You should use
`BufferOrEvent#moreAvailable()` to get next buffer and availability in the same
call. If there is more data available, just keep reading from the gate without
any extra synchronisation/callbacks. There is no need for `volatile boolean
moreAvailable`. We always should use either this
`BufferOrEvent#moreAvailable()` or relay on listeners/futures to inform us that
the availability has changed.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services