Commit f44b9ff
[Service Bus] Fix spurious DeliveryNotOnLinkException in session processor (Azure#47356) (Azure#49603)
* [Service Bus] Fix spurious DeliveryNotOnLinkException in session processor (Azure#47356)
A session-enabled ServiceBusProcessorClient that settles messages manually
(e.g. complete()) while auto-complete is left enabled logged a spurious
DeliveryNotOnLinkException ("...does not exist in the link's DeliveryMap") at
ERROR. The V2 session disposition path (SessionsMessagePump) never called
message.setIsSettled() on success, so the isSettled() guard could not absorb the
redundant auto-settlement the way the non-session and V1 session paths do. The
second disposition then reached the receive-link after the delivery had already
been removed from the DeliveryMap, producing the error log.
The message was always settled correctly on the broker; only the misleading
ERROR log is removed. Now the session path marks the message settled on a
successful disposition, mirroring ServiceBusReceiverAsyncClient, so a redundant
settle short-circuits at the already-settled guard.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* [Service Bus] Add regression test for session double-settle (Azure#47356)
Adds SessionsMessagePumpIsolatedTest#shouldNotReDispositionWhenHandlerSettlesWithAutoCompleteEnabled,
covering the V2 session path where a handler settles a message manually while auto-complete is
enabled. Verifies the message is marked settled and the redundant auto-settlement short-circuits at
the isSettled() guard so the receive-link sees exactly one disposition (no second attempt that would
raise DeliveryNotOnLinkException). Addresses the PR review feedback.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* [Service Bus] Use then(Mono.fromRunnable) to match sibling settle paths (Azure#47356)
Addresses PR review feedback: switch the session disposition success side-effect
from doOnSuccess to .<Void>then(Mono.fromRunnable(() -> message.setIsSettled())),
matching the pattern used by the non-session and V1 session paths in
ServiceBusReceiverAsyncClient. Behavior is unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: ksalazar-91 <ksalazar-91@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Eldert Grootenboer <eldert@eldert.net>1 parent 3e5340e commit f44b9ff
3 files changed
Lines changed: 72 additions & 1 deletion
File tree
- sdk/servicebus/azure-messaging-servicebus
- src
- main/java/com/azure/messaging/servicebus
- test/java/com/azure/messaging/servicebus
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
898 | 906 | | |
899 | 907 | | |
900 | 908 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
504 | 561 | | |
505 | 562 | | |
506 | 563 | | |
| |||
0 commit comments