Skip to content

Commit

Permalink
Release the state lock before calling the publish api
Browse files Browse the repository at this point in the history
Prior to this change, any problem in the communication path to pubsub
(e.g. bad connection, slow servers, etc) would not only tie up the
calling thread itself, but also other threads waiting to get hold of
the state lock as they try to publish over the same batch.

We only need to hold the state lock for the transition from
ACCEPTING_MESSAGES / STARTING to IN_PROGRESS. After that, since only
one thread is able to transition to IN_PROGRESS, we can safely release
the state lock before calling the publish api and eventually
transitioning to SUCCESS / ERROR.

Co-authored-by: Rencana Tarigan <rtarigan@bbmtek.com>
  • Loading branch information
sayap and rtarigan committed Apr 10, 2019
1 parent 93f8d71 commit 26ac207
Showing 0 changed files with 0 additions and 0 deletions.
Whitespace-only changes.

0 comments on commit 26ac207

Please sign in to comment.