fix: make InMemoryPushNotificationConfigStore thread-safe by kabir · Pull Request #1057 · a2aproject/a2a-java · GitHub
Skip to content

fix: make InMemoryPushNotificationConfigStore thread-safe - #1057

Merged
ehsavoie merged 3 commits into
a2aproject:mainfrom
kabir:fix/push-config-store-thread-safety
Aug 14, 2026
Merged

ehsavoie merged 3 commits into
a2aproject:mainfrom
kabir:fix/push-config-store-thread-safety

Conversation

@kabir

@kabir kabir commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Use ConcurrentHashMap with compute()/computeIfPresent() for atomic per-key operations and store immutable list snapshots via List.copyOf().

Follows up on #1044

Use ConcurrentHashMap with compute()/computeIfPresent() for atomic
per-key operations and store immutable list snapshots via List.copyOf().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Kabir Khan <kkhan@redhat.com>
@kabir
kabir force-pushed the fix/push-config-store-thread-safety branch from e595a77 to b36396f Compare August 12, 2026 09:40
@kabir
kabir requested a review from ehsavoie August 13, 2026 15:08
ehsavoie and others added 2 commits August 14, 2026 14:05
…n InMemoryPushNotificationConfigStore

- add concurrent limit-enforcement test using CyclicBarrier to verify
  compute() atomicity when two threads race for the last config slot
- drop unnecessary ArrayList copy when pageSize <= 0 since stored values
  are already immutable List.copyOf() snapshots

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
test(server-common): add concurrency test and remove redundant copy in InMemoryPushNotificationConfigStore
@ehsavoie
ehsavoie merged commit 9cff396 into a2aproject:main Aug 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants