Commit 807ecd0
authored
[Event Hubs Client] Capture Unobserved AMQP Link Close Errors (Azure#21426)
The AMQP transport library used by Event Hubs manages aspects of the transport
in the background, notably the flow of data into the prefetch queue. In doing
so it controls attempts to read data, and detecting connection/link failures to
provide resiliency for callers.
Access to the AMQP link is managed through the `FaultTolerantAmqpObject<T>` which
uses a `GetOrCreate` pattern to handle faults and provide a resilient experience
for callers. When a link was discarded due to a fault, it was not observable to
clients and a new link would be created on the next `GetOrCreate` call.
In the majority of scenarios, this behavior is desirable. However, in some
scenarios - such as a partition being stolen by another event consumer asserting
exclusive access, the failure must be surfaced to callers so that the correct
remidiation can be taken.
The focus of these changes is to ensure that errors causing link termination
are surfaced via logging and that a stolen partition is treated as a special
case and is always surfaced to callers.
Because this behavior was a direct impact to the load balancing aspects of
the event processor, testing exposed some additional load balancing gaps that
were also addressed. Lost partitions will now be detected more reliably and
the processor will proactively relinquish ownership and allow load balancing
to make recovery decisions.1 parent 554d35b commit 807ecd0
File tree
25 files changed
+1559
-123
lines changed- sdk/eventhub
- Azure.Messaging.EventHubs.Processor
- Azure.Messaging.EventHubs
- api
- src
- Amqp
- Consumer
- Core
- Diagnostics
- Primitives
- tests
- Amqp
- Connection
- Consumer
- Primitives
25 files changed
+1559
-123
lines changedLines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
Lines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
300 | 311 | | |
301 | 312 | | |
302 | 313 | | |
| |||
389 | 400 | | |
390 | 401 | | |
391 | 402 | | |
392 | | - | |
| 403 | + | |
| 404 | + | |
393 | 405 | | |
394 | | - | |
| 406 | + | |
| 407 | + | |
395 | 408 | | |
396 | 409 | | |
397 | 410 | | |
| |||
476 | 489 | | |
477 | 490 | | |
478 | 491 | | |
479 | | - | |
| 492 | + | |
480 | 493 | | |
481 | 494 | | |
482 | 495 | | |
| |||
520 | 533 | | |
521 | 534 | | |
522 | 535 | | |
523 | | - | |
524 | 536 | | |
525 | 537 | | |
526 | 538 | | |
| |||
Lines changed: 106 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
917 | 1023 | | |
918 | 1024 | | |
919 | 1025 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
17 | 31 | | |
18 | 32 | | |
19 | 33 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| |||
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| 442 | + | |
441 | 443 | | |
442 | 444 | | |
443 | 445 | | |
| |||
449 | 451 | | |
450 | 452 | | |
451 | 453 | | |
| 454 | + | |
452 | 455 | | |
453 | 456 | | |
454 | 457 | | |
| |||
462 | 465 | | |
463 | 466 | | |
464 | 467 | | |
| 468 | + | |
465 | 469 | | |
466 | 470 | | |
467 | 471 | | |
| |||
0 commit comments