Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release the state lock before calling the publish api
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