Uploaded image for project: 'Advanced Roadmaps'
  1. Advanced Roadmaps
  2. JPOSERVER-2368

Database Deadlock Prevents Plan Deletion

    XMLWordPrintable

    Details

      Description

      Summary

      Unable to delete Portfolio Plans due to database deadlock

      Steps to Reproduce

      • Create a Portfolio Plan
      • Attempt to delete the plan

      Expected Results

      The plan is deleted!

      Actual Results

      After clicking the Delete button a spinner will appear. If you wait for around 10 minutes the following exception will be displayed:

      Thread dumps show the delete thread never moves from the following state:

      "http-nio-8080-exec-16" #590 daemon prio=5 os_prio=31 tid=0x00007fa9f942f000 nid=0x6e0b runnable [0x0000700004348000]
         java.lang.Thread.State: RUNNABLE
      	at java.net.SocketInputStream.socketRead0(Native Method)
      	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
      	at java.net.SocketInputStream.read(SocketInputStream.java:171)
      	at java.net.SocketInputStream.read(SocketInputStream.java:141)
      	at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:143)
      	at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:112)
      	at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:71)
      	at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:272)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1659)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      	- locked <0x00000007b7a22048> (a org.postgresql.core.v3.QueryExecutorImpl)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:510)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:386)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:332)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
      	at com.querydsl.sql.dml.SQLDeleteClause.execute(SQLDeleteClause.java:195)
      	at com.atlassian.rm.common.persistence.BaseDeletePersistence.delete(BaseDeletePersistence.java:59)
      	at com.atlassian.rm.jpo.core.planteam.sql.PlanTeamDeletePersistence.access$201(PlanTeamDeletePersistence.java:29)
      	at com.atlassian.rm.jpo.core.planteam.sql.PlanTeamDeletePersistence.delete(PlanTeamDeletePersistence.java:122)
      	at com.atlassian.rm.jpo.core.planteam.DefaultPlanTeamService$7$1.perform(DefaultPlanTeamService.java:249)
      	at com.atlassian.rm.common.persistence.transaction.Registry.run(Registry.java:44)
      	at com.atlassian.rm.jpo.core.planteam.DefaultPlanTeamService$7.apply(DefaultPlanTeamService.java:244)
      	at com.atlassian.rm.common.persistence.transaction.TransactionHandler$4.apply(TransactionHandler.java:72)
      	at com.atlassian.rm.common.persistence.transaction.TransactionHandler$4.apply(TransactionHandler.java:69)
      	at com.atlassian.rm.common.persistence.transaction.TransactionHandler.inTransaction(TransactionHandler.java:139)
      	at com.atlassian.rm.common.persistence.transaction.TransactionHandler.inNewTransaction(TransactionHandler.java:127)
      	at com.atlassian.rm.common.persistence.transaction.TransactionHandler.access$000(TransactionHandler.java:14)
      	at com.atlassian.rm.common.persistence.transaction.TransactionHandler$1.apply(TransactionHandler.java:36)
      	at com.atlassian.rm.common.persistence.DefaultDatabaseProvider$1.perform(DefaultDatabaseProvider.java:30)
      	at com.atlassian.rm.common.persistence.env.JiraDatabaseProvider$1.perform(JiraDatabaseProvider.java:41)
      	at com.atlassian.rm.common.bridges.jira.persistence.JiraDatabaseProviderBridge63.execute(JiraDatabaseProviderBridge63.java:66)
      	at com.atlassian.rm.common.persistence.env.JiraDatabaseProvider.execute(JiraDatabaseProvider.java:36)
      	at com.atlassian.rm.common.persistence.DefaultDatabaseProvider.run(DefaultDatabaseProvider.java:26)
      	at com.atlassian.rm.common.persistence.transaction.TransactionHandler.reuseExistingDatabaseTransaction(TransactionHandler.java:32)
      	at com.atlassian.rm.common.persistence.transaction.TransactionHandler.reuseExistingDatabaseTransaction(TransactionHandler.java:77)
      	at com.atlassian.rm.jpo.core.planteam.DefaultPlanTeamService.deleteAllByTeam(DefaultPlanTeamService.java:240)
      	at com.atlassian.rm.teams.bridges.jpo2.impl00.planteam.PlanTeamServiceBridge00$4.perform(PlanTeamServiceBridge00.java:68)
      	at com.atlassian.rm.teams.bridges.jpo2.impl00.planteam.PlanTeamServiceBridge00$4.perform(PlanTeamServiceBridge00.java:65)
      	at com.atlassian.rm.common.bridges.api.plugins.access.DefaultBundleServiceAccessor.perform(DefaultBundleServiceAccessor.java:39)
      	at com.atlassian.rm.teams.bridges.jpo2.impl00.planteam.PlanTeamServiceBridge00.deleteAllByTeam(PlanTeamServiceBridge00.java:65)
      	at com.atlassian.rm.teams.core.planteam.DefaultPlanTeamService.deleteAllByTeam(DefaultPlanTeamService.java:64)
      	at com.atlassian.rm.teams.core.team.BaseDefaultTeamService.deleteTeam(BaseDefaultTeamService.java:217)
      	at com.atlassian.rm.teams.core.team.DefaultFullTeamService.deleteTeam(DefaultFullTeamService.java:13)
      	at com.atlassian.rm.teams.core.team.BaseEnrichedTeamService.deleteTeam(BaseEnrichedTeamService.java:129)
      	at com.atlassian.rm.teams.core.team.DefaultEnrichedFullTeamService.deleteTeam(DefaultEnrichedFullTeamService.java:12)
      	at com.atlassian.rm.jpo.bridges.teams.impl00.teams.TeamServiceBridge00$5.perform(TeamServiceBridge00.java:393)
      	at com.atlassian.rm.jpo.bridges.teams.impl00.teams.TeamServiceBridge00$5.perform(TeamServiceBridge00.java:388)
      	at com.atlassian.rm.common.bridges.api.plugins.access.DefaultBundleServiceAccessor.perform(DefaultBundleServiceAccessor.java:39)
      	at com.atlassian.rm.jpo.bridges.teams.impl00.teams.TeamServiceBridge00.deleteTeam(TeamServiceBridge00.java:388)
      	at com.atlassian.rm.jpo.env.teams.JiraTeamService.deleteTeam(JiraTeamService.java:92)
      	at com.atlassian.rm.jpo.core.planteam.sql.PlanTeamDeletePersistence.deleteGlobalTeamsIfNotShared(PlanTeamDeletePersistence.java:144)
      	at com.atlassian.rm.jpo.core.planteam.sql.PlanTeamDeletePersistence.access$000(PlanTeamDeletePersistence.java:29)
      	at com.atlassian.rm.jpo.core.planteam.sql.PlanTeamDeletePersistence$1.onBeforeCommit(PlanTeamDeletePersistence.java:81)
      	at com.atlassian.rm.common.persistence.ConnectionAdapter$1$1.onBeforeCommit(ConnectionAdapter.java:79)
      	at com.atlassian.rm.common.persistence.env.JiraDatabaseProvider$4$1.onBeforeCommit(JiraDatabaseProvider.java:149)
      	at com.atlassian.rm.common.bridges.jira.persistence.JiraDatabaseProviderBridge63.execute(JiraDatabaseProviderBridge63.java:70)
      	at com.atlassian.rm.common.persistence.env.JiraDatabaseProvider.execute(JiraDatabaseProvider.java:36)
      	at com.atlassian.rm.common.persistence.DefaultDatabaseProvider.run(DefaultDatabaseProvider.java:26)
      	at com.atlassian.rm.common.persistence.BaseDeletePersistence.delete(BaseDeletePersistence.java:34)
      	at com.atlassian.rm.jpo.core.plan.DefaultPlanService.deletePlan(DefaultPlanService.java:426)
      	at com.atlassian.rm.jpo.rest.service.plan.PlanRestEndpoint.delete(PlanRestEndpoint.java:128)
      

      Checking at the database we can see a deadlock:

      -[ RECORD 1 ]-------------------------+----------------------------------------------------------------------
      blocked_pid                           | 24713
      blocked_user                          | atlassian
      blocking_pid                          | 24712
      blocking_user                         | atlassian
      blocked_statement                     | delete from "AO_D9132D_PLANTEAM" where "AO_D9132D_PLANTEAM"."ID" = $1
      current_statement_in_blocking_process | delete from "AO_D9132D_PLAN" where "AO_D9132D_PLAN"."ID" = $1
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jels joe
              Reporter:
              ddiblasio David Di Blasio
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: