Commit 73c6233
fix(bigquery): address round-3 review — atomic append admission, single close-owned drain deadline
Resolves both round-3 P1 findings on PR google#1344:
1. Append admission is now atomic with lifecycle finalization:
InvocationLifecycle.runIfActive executes the processor append inside
the token's monitor, shared with markFinalized. A continuation that
passed the processor-map gate can no longer get descheduled across
finalization and then offer into a drained queue or record an
after_close drop that the already-delivered final snapshot misses;
finalization now waits for any in-flight admission (a short,
non-blocking-offer critical section), and post-finalization
admissions are refused and counted at the plugin level.
2. The explicit pre-close flush in invocation finalization is removed:
it ran before close() published its deadline and consumed a separate
full append budget, doubling the effective drain bound with multiple
queued batches. closeAndFold now owns the complete drain under one
shutdownTimeout deadline.
Cleanup per review: the stale tombstone-residual javadoc on
getOrCreateProcessorIfActive now describes the durable-token guarantee,
and the TraceManager class javadoc no longer claims within-branch
execution is sequential (tools run concurrently and use operation-
identity spans).
Tests: finalization blocks on an in-flight admission and refuses the
next one (latch-based interleaving), and a two-batch never-completing
drain finishes within a single shutdownTimeout bound. Focused BQAA
suite 165 passed (previous: 163); full core 1,621 passed / 0 failed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 2cdd638 commit 73c6233
3 files changed
Lines changed: 122 additions & 16 deletions
File tree
- core/src
- main/java/com/google/adk/plugins/agentanalytics
- test/java/com/google/adk/plugins/agentanalytics
Lines changed: 44 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
93 | 102 | | |
94 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
95 | 116 | | |
96 | | - | |
| 117 | + | |
97 | 118 | | |
98 | 119 | | |
99 | 120 | | |
100 | | - | |
| 121 | + | |
101 | 122 | | |
102 | 123 | | |
103 | 124 | | |
| |||
269 | 290 | | |
270 | 291 | | |
271 | 292 | | |
272 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
273 | 305 | | |
274 | 306 | | |
275 | 307 | | |
| |||
285 | 317 | | |
286 | 318 | | |
287 | 319 | | |
288 | | - | |
289 | | - | |
290 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
291 | 323 | | |
292 | 324 | | |
293 | 325 | | |
| |||
405 | 437 | | |
406 | 438 | | |
407 | 439 | | |
408 | | - | |
409 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
410 | 444 | | |
411 | 445 | | |
412 | 446 | | |
| |||
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
Lines changed: 69 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
411 | 480 | | |
0 commit comments