Commit b941ac7
fix(bigquery): address round-4 review — shared shutdown deadline, collision-proof tool identity, HITL content parity
Resolves both round-4 P1 findings and the P2 on PR google#1344:
1. One absolute deadline per shutdown operation: ensureInvocationCompleted
computes its deadline at subscription (Completable.defer) and shares it
between the pending-task wait and the processor drain; plugin-wide
close() shares one deadline across the task wait, every processor's
drain, and both executor terminations. BatchProcessor gains
deadline-accepting closeAndFold/close variants so each drain consumes
only the remaining budget — a stuck parse plus a queued processor, or
N stuck processors, are all bounded by a single shutdownTimeout.
2. Collision-proof tool operation identity: the framework materializes an
absent function-call ID as "", so two concurrent id-less calls
collided and cross-popped. toolOperationId now uses the real ID when
non-empty, else a synthetic ID keyed by ToolContext instance identity
(weak-keys cache; the same instance flows through before/after/error
callbacks of one call). hitlPairKeys also filters empty-string IDs,
which are useless as join keys.
3. HITL completion content normalized to "result" on the event path,
matching the user-message path and the Python plugin, so one event
type has one queryable content shape.
Tests: concurrent id-less tools keep span ownership out of completion
order (plugin-level, span-id pairing per tool); multi-batch drain bound
tightened to <900ms so the old two-deadline behavior fails; new
pending-task-plus-drain and multi-stuck-processor cases assert the
shared bound; HITL event-path completion asserts content.result.
Focused BQAA suite 168 passed (previous: 165); full core 1,624 passed /
0 failed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 73c6233 commit b941ac7
5 files changed
Lines changed: 221 additions & 34 deletions
File tree
- core/src
- main/java/com/google/adk/plugins/agentanalytics
- test/java/com/google/adk/plugins/agentanalytics
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
341 | 351 | | |
342 | | - | |
| 352 | + | |
343 | 353 | | |
344 | 354 | | |
345 | 355 | | |
346 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
347 | 361 | | |
348 | 362 | | |
349 | 363 | | |
| |||
354 | 368 | | |
355 | 369 | | |
356 | 370 | | |
357 | | - | |
358 | | - | |
359 | | - | |
| 371 | + | |
| 372 | + | |
360 | 373 | | |
361 | 374 | | |
362 | 375 | | |
| |||
Lines changed: 34 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
418 | 421 | | |
419 | 422 | | |
420 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
421 | 447 | | |
422 | 448 | | |
423 | 449 | | |
| |||
427 | 453 | | |
428 | 454 | | |
429 | 455 | | |
430 | | - | |
| 456 | + | |
| 457 | + | |
431 | 458 | | |
432 | 459 | | |
433 | 460 | | |
| |||
719 | 746 | | |
720 | 747 | | |
721 | 748 | | |
| 749 | + | |
| 750 | + | |
722 | 751 | | |
723 | | - | |
| 752 | + | |
724 | 753 | | |
725 | 754 | | |
726 | 755 | | |
| |||
1076 | 1105 | | |
1077 | 1106 | | |
1078 | 1107 | | |
1079 | | - | |
1080 | | - | |
| 1108 | + | |
1081 | 1109 | | |
1082 | 1110 | | |
1083 | 1111 | | |
| |||
1105 | 1133 | | |
1106 | 1134 | | |
1107 | 1135 | | |
1108 | | - | |
1109 | | - | |
| 1136 | + | |
1110 | 1137 | | |
1111 | 1138 | | |
1112 | 1139 | | |
| |||
1148 | 1175 | | |
1149 | 1176 | | |
1150 | 1177 | | |
1151 | | - | |
1152 | | - | |
| 1178 | + | |
1153 | 1179 | | |
1154 | 1180 | | |
1155 | 1181 | | |
| |||
Lines changed: 38 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
402 | 401 | | |
403 | 402 | | |
404 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
405 | 417 | | |
406 | 418 | | |
407 | 419 | | |
| |||
437 | 449 | | |
438 | 450 | | |
439 | 451 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
447 | 459 | | |
448 | 460 | | |
449 | 461 | | |
| |||
494 | 506 | | |
495 | 507 | | |
496 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
497 | 518 | | |
498 | 519 | | |
499 | 520 | | |
| |||
519 | 540 | | |
520 | 541 | | |
521 | 542 | | |
522 | | - | |
523 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
524 | 546 | | |
525 | 547 | | |
526 | 548 | | |
| |||
538 | 560 | | |
539 | 561 | | |
540 | 562 | | |
541 | | - | |
542 | | - | |
543 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
544 | 567 | | |
545 | 568 | | |
546 | | - | |
547 | | - | |
| 569 | + | |
| 570 | + | |
548 | 571 | | |
549 | 572 | | |
550 | 573 | | |
| |||
Lines changed: 68 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
1041 | | - | |
| 1040 | + | |
| 1041 | + | |
1042 | 1042 | | |
1043 | | - | |
| 1043 | + | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | | - | |
1047 | | - | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1048 | 1056 | | |
1049 | 1057 | | |
1050 | 1058 | | |
| |||
2034 | 2042 | | |
2035 | 2043 | | |
2036 | 2044 | | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
2037 | 2100 | | |
2038 | 2101 | | |
2039 | 2102 | | |
| |||
0 commit comments