Skip to content

Unbalanced synchronization of ResponseContext.REGISTERED_KEYS #9106

@leventov

Description

@leventov

To make it really thread-safe:

  1. keyOf() and getAllRegisteredKeys() should be made synchronized;
  2. getAllRegisteredKeys() should return a defensive copy: new TreeMap<>(REGISTERED_KEYS).values()

Relevant concurrency checklist items: https://github.com/code-review-checklists/java-concurrency#unsafe-concurrent-point-read, https://github.com/code-review-checklists/java-concurrency#unsafe-concurrent-iteration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions