flow rootfs push: ask about missing chunks 20,000 at a time 01043bfff9fd
50,000 chunk names made a question of about 3.3 MB, over a hub's 2 MB default body limit, so pushing an 11 GB image failed with 413. 20,000 is about 1.3 MB and works against any hub. refs andymccall/oxygenhub#147
- Author
- Andy McCall @andymccall <[email protected]>
- When
- · 2026-10-12 19:32 UTC
- Signature
- ✔ signed by Andy McCall
- Hash
01043bfff9fd33efeb1e0c0e63bcfcb329b21b36522ae199020df8604816275e- Depends on
- 4cf0c99a1486
- Depended on by
- nothing yet
- In bookmarks
- main
- In tags
- v0.2.0 v0.3.0 v0.3.1 v0.4.0 v0.5.0 v0.5.1 v0.5.2 v0.5.3
- Edits
- 3 atoms, 0 tree operations, 1 file
Browse the tree at this change
modified crates/flow/src/images.rs +5 −1
| … | 14 unchanged lines |
||
| 15 | 15 | ||
| 16 | 16 | /// Requests in flight at once. |
|
| 17 | 17 | const PARALLEL: usize = 8; |
|
| 18 | + | /// Chunk names per `missing` question. |
|
| 19 | + | const ASK: usize = 20_000; |
|
| 18 | 20 | ||
| 19 | 21 | /// A hub's image endpoints, with a token. |
|
| 20 | 22 | pub struct Client { |
|
| … | 65 unchanged lines |
||
| 86 | 88 | bail!("{} holds an image named {}, not {}: the file was changed", path.display(), &m.hash[..12], &hash[..12]); |
|
| 87 | 89 | } |
|
| 88 | 90 | let mut missing: HashSet<String> = HashSet::new(); |
|
| 89 | - | for ask in m.needed().chunks(50_000) { |
|
| 91 | + | // 20,000 names is about 1.3 MB of JSON: under a hub's 2 MB default |
|
| 92 | + | // body limit, which refused 50,000 at a time (oxygenhub#147). |
|
| 93 | + | for ask in m.needed().chunks(ASK) { |
|
| 90 | 94 | let url = format!("{}/flow/images/missing", self.base); |
|
| 91 | 95 | let r: serde_json::Value = self |
|
| 92 | 96 | .agent |
|
| … | 128 unchanged lines |