Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-20965

DVCS webhook processing fail with the "There is already an active ThreadEventsCapture" error

    XMLWordPrintable

Details

    Description

      Issue Summary

      Jira's DVCS webhooks respond with the HTTP 500 error and the error message There is already an active ThreadEventsCapture

      Steps to Reproduce

      Could not reproduce

      Expected Results

      The webhooks reaching /rest/bitbucket/1.0/webhook/github are processed normally.

      Actual Results

      The processing fails for some threads.

      Enabling the com.atlassian.jira.plugins.dvcs package as DEBUG, we can see the messages in the logs:

      2021-05-21 17:07:16,075+0000 http-nio-8080-exec-52 DEBUG anonymous 102x1234x5 - X.X.X.X /rest/bitbucket/1.0/webhook/github [c.a.j.p.d.r.external.v1.HookResource] Received GitHub pull_request event
      2021-05-21 17:07:16,076+0000 http-nio-8080-exec-52 DEBUG anonymous 102x1234x5 - X.X.X.X /rest/bitbucket/1.0/webhook/github [c.a.j.p.dvcs.service.RepositoryServiceImpl] Finding repository with URL [https://github.com/myorg/myrepo] for organization [22]
      2021-05-21 17:07:16,090+0000 http-nio-8080-exec-52 DEBUG anonymous 102x1234x5 - X.X.X.X /rest/bitbucket/1.0/webhook/github [c.a.j.p.d.r.external.v1.HookResource] Failed to execute web-hook
      java.lang.IllegalStateException: There is already an active ThreadEventsCapture
      	at com.atlassian.jira.plugins.dvcs.event.ThreadEvents.startCapturing(ThreadEvents.java:45)
      	at com.atlassian.jira.plugins.dvcs.rest.webhook.GitHubHookProcessor.processPullRequest(GitHubHookProcessor.java:231)
      	at com.atlassian.jira.plugins.dvcs.rest.webhook.GitHubHookProcessor.lambda$savePullRequest$5(GitHubHookProcessor.java:221)
      	at java.base/java.util.Optional.ifPresent(Optional.java:183)
      	at com.atlassian.jira.plugins.dvcs.rest.webhook.GitHubHookProcessor.savePullRequest(GitHubHookProcessor.java:221)
      	at com.atlassian.jira.plugins.dvcs.rest.external.v1.HookResource.handlePullRequestEvent(HookResource.java:136)
      	at com.atlassian.jira.plugins.dvcs.rest.external.v1.HookResource.lambda$githubHookEndpoint$2(HookResource.java:120)
      	at com.atlassian.jira.plugins.dvcs.rest.external.v1.HookResource.handleRequest(HookResource.java:156)
      	at com.atlassian.jira.plugins.dvcs.rest.external.v1.HookResource.githubHookEndpoint(HookResource.java:116)
      

      Workaround

      None. Restarting the server should get the webhook processing working again, but the issue is prone to return in the affected environments.

      Attachments

        Issue Links

          Activity

            People

              1c017edd2c81 awojtasik
              5fb7769fcbc7 Allan Gandelman
              Votes:
              54 Vote for this issue
              Watchers:
              34 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: