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

      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.

            [JSWSERVER-20965] DVCS webhook processing fail with the "There is already an active ThreadEventsCapture" error

            Marissa Jensen (Inactive) made changes -
            Remote Link Original: This issue links to "Page (Confluence)" [ 667307 ]
            Marissa Jensen (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 667307 ]
            Marissa Jensen (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 660712 ]
            Marissa Jensen (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 658225 ]
            Marissa Jensen (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 655915 ]
            Saranjeet Kaur (Inactive) made changes -
            Affects Version/s New: 8.20.6 [ 98800 ]
            Marissa Jensen (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 654405 ]
            Marissa Jensen (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 651640 ]
            Marissa Jensen (Inactive) made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 651603 ]
            Mateusz Beczek made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]

              1c017edd2c81 awojtasik
              5fb7769fcbc7 Allan Gandelman
              Affected customers:
              54 This affects my team
              Watchers:
              34 Start watching this issue

                Created:
                Updated:
                Resolved: