NicoK commented on a change in pull request #6974: [FLINK-10727][network]
remove unnecessary synchronization in SingleInputGate#requestPartitions()
URL: https://github.com/apache/flink/pull/6974#discussion_r229671494
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java
##########
@@ -477,8 +477,8 @@ public boolean isFinished() {
@Override
public void requestPartitions() throws IOException,
InterruptedException {
- synchronized (requestLock) {
- if (!requestedPartitionsFlag) {
+ if (!requestedPartitionsFlag) {
Review comment:
1. there is no `else` - do you think this would be simpler?
```
if (requestedPartitionsFlag) {
return;
}
synchronized (...)
```
2. yes - but thereby, I'm making `SingleInputGate` adhere the same standards
as `UnionInputGate` for this overload of `requestPartitions` - the behaviour
should be consistent, one way or the other. Should I add a note to the method's
JavaDoc?
----------------------------------------------------------------
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