Commit 7b581c2
Use DisposedCancellationToken for message bus topic/subscription setup
EnsureTopicCreatedAsync and EnsureTopicSubscriptionAsync are one-time infrastructure setup methods. Previously they received the caller's cancellation token (via the linked token in PublishAsync, or directly in SubscribeAsync). This meant that if an individual caller cancelled their publish or subscribe operation, topic creation or subscription setup could be aborted mid-way, leaving infrastructure in a half-created state for subsequent callers — the same class of bug fixed in queue creation (99e3353).
Now both setup methods receive DisposedCancellationToken, ensuring they only abort when the message bus itself is being disposed. The actual publish and subscribe operations continue to use the linked/caller token so they remain individually cancellable.
Affected concrete implementations (Azure Service Bus, RabbitMQ, SQS, Kafka, Redis) all receive the token through the overridden method parameter, so their internal lock acquisitions and network calls automatically benefit from this fix.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 65e3116 commit 7b581c2
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
197 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
198 | 202 | | |
199 | 203 | | |
200 | 204 | | |
| |||
0 commit comments