Commit 9cd7a12
authored
[Store] Fix P2PClientService::Put silently swallowing write errors (#1825)
* fix: propagate PutViaRoute error in P2PClientService::Put
Put() logged errors from PutViaRoute but always returned success (empty
expected), causing callers to believe the write succeeded when the
underlying route write actually failed with SEGMENT_NOT_FOUND or
NO_AVAILABLE_HANDLE.
Return the error for non-idempotent failures while still treating
REPLICA_NUM_EXCEEDED / REPLICA_ALREADY_EXISTS as success (object already
stored).
Fixes #1817
* fix: also capture remote write errors in PutViaRoute result
Address review feedback from Gemini Code Assist:
1. PutViaRoute: assign write_result error to result before continue
in the remote write path. Previously, if all remote candidates
failed, result stayed default-initialized (success) because only
local write failures were captured.
2. Put: simplify return to use result directly instead of
re-wrapping with tl::unexpected.1 parent 99fb4d4 commit 9cd7a12
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| 461 | + | |
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
| |||
505 | 506 | | |
506 | 507 | | |
507 | 508 | | |
508 | | - | |
509 | | - | |
| 509 | + | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
511 | 513 | | |
512 | 514 | | |
513 | 515 | | |
| |||
0 commit comments