Commit dbdcada
engineering: Reduce verbosity of httpsubfile in high-retry scenarios (#538)
# 🔍 Description
Clarity improvements in `crates/trident/src/io_utils/http/subfile.rs` to
reduce log noise when servers return empty (0-byte) responses:
- **Variable rename**: `received_empty_response` →
`previous_response_was_empty` — better captures that the flag reflects
the *prior* iteration's state, not the current one.
- **Trace message**: `"Successfully populated PartialResponseReader for
subfile '{}' at position {} with {} bytes available"` → `"Received a
response for subfile '{}' at position {} with {} bytes"` — shorter,
avoids implementation-detail noise.
- **Silent retry path**: `populate_reader` now retries silently after an
empty response (50ms backoff), logging only the first empty-response
occurrence to avoid flooding logs with repeated identical messages.
- **`silent` parameter**: `new_partial_response_reader` gains a `silent:
bool` flag that suppresses the "Requesting HTTP range" trace during
silent retries.
- **Code comments**: Added an inline comment above the
`new_partial_response_reader` call stating that the request should be
made silently if we've already tried before and got a zero-length
response, and expanded the `new_partial_response_reader` doc comment to
describe the `silent` parameter and its effect (when `true`, no logging
is produced).
# 🤔 Rationale
The old name and message were verbose and subtly misleading. In
high-retry scenarios (e.g. server returning repeated empty responses),
the original code would emit identical trace lines on every attempt. The
silent retry path suppresses this noise while still logging the first
occurrence so the event is observable.
# 📝 Checks
- [ ] Check
[dev-docs/manual-validation.md](/dev-docs/manual-validation.md)
# 📌 Follow-ups
TODO:
- #0000
# 🗒️ Notes
<!-- START COPILOT CODING AGENT TIPS -->
---
🔒 GitHub Advanced Security automatically protects Copilot coding agent
pull requests. You can protect all pull requests by enabling Advanced
Security for your repositories. [Learn more about Advanced
Security.](https://gh.io/cca-advanced-security)
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frhuelsz <97629030+frhuelsz@users.noreply.github.com>1 parent 06f9dd0 commit dbdcada
1 file changed
Lines changed: 43 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
169 | 199 | | |
170 | 200 | | |
171 | 201 | | |
| |||
181 | 211 | | |
182 | 212 | | |
183 | 213 | | |
184 | | - | |
185 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
186 | 218 | | |
187 | 219 | | |
188 | 220 | | |
| |||
193 | 225 | | |
194 | 226 | | |
195 | 227 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
202 | 236 | | |
203 | 237 | | |
204 | 238 | | |
| |||
0 commit comments