Background
Raised in PR #330 review (Copilot, comment r2936080069).
DynamoDbIncrementRepository.delete() and keys() return Uni<…> but internally call the synchronous DynamoDbClient, which blocks the calling thread. When these methods are invoked on an event-loop thread (e.g. from a reactive REST endpoint) this can stall the Vert.x event loop.
Affected methods
| Method |
Current client |
Problem |
delete(String key) |
asyncClient.deleteItem(…) |
OK — uses async client ✓ |
keys() |
asyncClient.scan(…) |
OK — uses async client ✓ |
get(String key) |
client (sync) |
Blocking — called from non-@Blocking context |
set(String key, long value) |
client (sync) |
Blocking — called from non-@Blocking context |
increment(String key, long by) |
client (sync) |
Blocking — called from non-@Blocking context |
Expected fix
Either:
- Annotate the resource/service methods that call
get/set/increment with @Blocking, or
- Switch
get, set, increment to use DynamoDbAsyncClient and return Uni.
References
Background
Raised in PR #330 review (Copilot, comment r2936080069).
DynamoDbIncrementRepository.delete()andkeys()returnUni<…>but internally call the synchronousDynamoDbClient, which blocks the calling thread. When these methods are invoked on an event-loop thread (e.g. from a reactive REST endpoint) this can stall the Vert.x event loop.Affected methods
delete(String key)asyncClient.deleteItem(…)keys()asyncClient.scan(…)get(String key)client(sync)@Blockingcontextset(String key, long value)client(sync)@Blockingcontextincrement(String key, long by)client(sync)@BlockingcontextExpected fix
Either:
get/set/incrementwith@Blocking, orget,set,incrementto useDynamoDbAsyncClientand returnUni.References