Skip to content

Potential deadlock in AutorecoveringConnection #648

@maxbrodin

Description

@maxbrodin

The code in AutorecoveringConnection.java acquires synchronization objects in different order (once acquires consumers and then recordedQueues, another time acquires recordedQueues and then consumers).

Acquiring synchronization objects in different order can cause circular wait (deadlock).

The first order is: (1) first acquire consumers and then recordedQueues:

  • enter public method excludeQueueFromRecovery() at line 984
  • acquire synchronization on consumers at line 987
  • acquire synchronization on recordedQueues at line 988

The second order is: (2) first acquire recordedQueues and then consumers:

  • enter public method recoverQueue() at line 715
  • acquire synchronization on recordedQueues at line 732
  • call deleteRecordedQueue() at line 740
  • call maybeDeleteRecordedAutoDeleteExchange() at line 973
  • acquire synchronization on consumers at line 1035

initially reported by Adrian Nistor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions