Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-665

Concurrency issue when logging in a user via trusted apps that has never used FishEye before

    XMLWordPrintable

Details

    Description

      The following Exception was found in the FishEye logs after trying to perform a trusted apps call on FishEye, and FishEye returned status 500:

      java.lang.RuntimeException: database error getting justadmin from fisheye DB:User named justadmin already exists.
          at com.atlassian.fisheye.trustedapplications.FisheyeUserResolver.resolve(FisheyeUserResolver.java:21)
          at com.atlassian.seraph.filter.TrustedApplicationsFilter$AuthenticatorImpl.authenticate(TrustedApplicationsFilter.java:459)
          at com.atlassian.seraph.filter.TrustedApplicationsFilter.authenticate(TrustedApplicationsFilter.java:133)
          at com.atlassian.seraph.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:110)
          at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
          at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
          at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1136)
          at com.cenqua.fisheye.web.filters.UpfrontFilter.doFilter(UpfrontFilter.java:39)
          at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1136)
          at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
          at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
          at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
          at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
          at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404)
          at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
          at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
          at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
          at org.mortbay.jetty.Server.handle(Server.java:324)
          at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
          at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
          at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
          at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
          at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
          at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
          at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
      

      What appears to be happening is that if a Crowd user has never accessed FishEye before, they get put in the database. If two requests by the same user arrive concurrently, then this error may occur, it seems to be a concurrency issue in UserManager. Two requests arriving concurrently is not an impossible thing to happen, as both the JIRA Studio global search and Activity Streams issue two concurrent requests, one for Crucible, one for FishEye, during their normal operation. If that user has never accessed FishEye before (highly possible in both cases, particularly in JIRA Studio where there are some users that never interact with FishEye directly) then the above exception occurs intermittently. This bug has been causing JIRA Studio functional tests to fail intermittently for quite a while now.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jroper James Roper [Atlassian]
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: