Commit eff5122
committed
🐛 Correct race condition in chunked uploads
In multi-pod environments with a shared file system, chunked uploads were failing due to a race condition. The file size was being read from a cache, which could be stale if another pod had recently written a chunk. This resulted in an incorrect size check, causing parts of the file to be overwritten.
This commit fixes the issue by changing how the file size is retrieved. It now opens the file for reading to get the current size directly from the file handle, bypassing any filesystem attribute caching. This ensures an accurate size check and prevents file corruption during chunked uploads.1 parent d2db511 commit eff5122
1 file changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments