App (add-on) gets flooded with PullRequestRescopedEvent

Our app (Workzone for Bitbucket) listens to PullRequestRescopedEvent. In some instances there are floods of this event type in a very short amount of time.

The app performs a merge-check pullRequestService.canMerge(...)

The event listener has 2 choices

  1. process events synchronously - this leads to event thread exhaustion.
  2. process events async - this leads to JDBC pool exhaustion due to pull request lookups

I am wondering where such a flood of PullRequestRescopedEvent in a short amount of time may originate? What can trigger this to happen?

As for timing - the merge-check doesn’t need to be performed in-sync for notifications to be sent out. Is there a way to limit the JDBC connection pool allocated - so the event handler can be made async again?

Thanks for your thoughts and comments.

Kind regards, Ulrich

1 Like