NicoK opened a new pull request #6555: [FLINK-10142][network] reduce locking 
around credit notification
URL: https://github.com/apache/flink/pull/6555
 
 
   ## What is the purpose of the change
   
   When credit-based flow control was introduced, we also added some checks and 
optimisations for uncommon code paths that make common code paths unnecessarily 
more expensive, e.g. checking whether a channel was released before forwarding 
a credit notification to Netty. Such checks would have to be confirmed by the 
Netty thread anyway and thus only add additional load for something that 
happens only once (per channel). This PR removes these additional checks.
   
   Please note that this PR builds upon #6553.
   
   ## Brief change log
   
   - from `PartitionRequestClient`: remove checking whether we have already 
been disposed
   - from `RemoteInputChannel#notifyCreditAvailable()`: remove check for 
`isReleased` (checked when the notification arrives at Netty's thread)
   - from `RemoteInputChannel#notifyBufferAvailable()`: we must check inside 
`synchronized (bufferQueue)` anyway and there is no race condition with 
`releaseAllResources()` as previously mentioned there (the previous check also 
did not really prevent any race if it existed!)
   
   ## Verifying this change
   
   - covered by existing tests, such as `RemoteInputChannelTest` and in general 
everything using the network stack
   - added 
`RemoteInputChannelTest#testConcurrentNotifyBufferAvailableAndRelease`
   - check for reduced CPU load (together with #6553)
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): **no**
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: **no**
     - The serializers: **no**
     - The runtime per-record code paths (performance sensitive): **no** (per 
buffer)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: **no**
     - The S3 file system connector: **no**
   
   ## Documentation
   
     - Does this pull request introduce a new feature? **no**
     - If yes, how is the feature documented? **not applicable**
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to