Commit 516000b
ChangeFeedProcessor: Fixes blocking review comments for lease export
1. Eager MemoryStream validation: WithInMemoryLeaseContainer now
checks that the stream is expandable at config time via
SetLength(same length). A MemoryStream(byte[]) is writable but
not expandable - SetLength/Write throws NotSupportedException
when serialized data exceeds original capacity. Failing fast at
config time prevents silent data loss at shutdown.
2. StopAsync propagates ShutdownAsync exceptions: Removed try/finally
and catch-swallow pattern. ShutdownAsync runs sequentially after
partitionManager.StopAsync() so persistence failures propagate
to the caller. partitionManager.StopAsync() rarely fails, and
when it does the caller already receives that exception.
Silently swallowing persistence failures defeats the feature
guarantee.
3. Log timing: Moved 'Processor stopped.' trace after ShutdownAsync
for consistency with StartAsync pattern.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 20d52c4 commit 516000b
2 files changed
Lines changed: 27 additions & 22 deletions
File tree
- Microsoft.Azure.Cosmos/src/ChangeFeedProcessor
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
269 | 284 | | |
270 | 285 | | |
271 | 286 | | |
| |||
Lines changed: 12 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
103 | 93 | | |
104 | 94 | | |
105 | 95 | | |
| |||
0 commit comments