Commit 6dc5c93
committed
refactor: use EnvTask's BlockConstruction span instead of ad-hoc instrument
Addresses Fraser's review on PR #269:
- Drop the #[instrument] attribute from BundlePoller::task_future.
Long-lived tasks shouldn't keep a single span open forever, and
the Span::current() lookup inside record_block_number was flaky
depending on the runtime log level.
- Drop the record_block_number helper. Per-block context is already
carried by the BlockConstruction span attached to each SimEnv
(see EnvTask, env.rs:294), which already populates sim.ru.number,
sim.host.number, sim.slot, etc. — the field names Fraser pointed
to.
- In the env-change branch of the select loop, capture
env.clone_span() and use .instrument() on the inline async block
that runs the refetch. This mirrors how SubmitTask::task_future
picks up SimResult::clone_span() per work item, and how
CacheTask::task_future enters env.span() for its sync work.1 parent f45c986 commit 6dc5c93
1 file changed
Lines changed: 15 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | 227 | | |
232 | | - | |
233 | | - | |
234 | 228 | | |
235 | 229 | | |
236 | 230 | | |
| |||
261 | 255 | | |
262 | 256 | | |
263 | 257 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
267 | 272 | | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
| |||
0 commit comments