Skip to content

Commit

Permalink
[FLINK-16057][task] Optimize TaskMailbox state retrieval
Browse files Browse the repository at this point in the history
Don't lock in TaskMailboxImpl.getState for task thread.
This makes ContinuousFileReaderOperator about 29% faster.
  • Loading branch information
rkhachatryan authored and pnowojski committed Jun 2, 2020
1 parent 1a69cb9 commit 31d661d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ public List<Mail> close() {
@Nonnull
@Override
public State getState() {
if (isMailboxThread()) {
return state;
}
final ReentrantLock lock = this.lock;
lock.lock();
try {
Expand Down

0 comments on commit 31d661d

Please sign in to comment.