Commit de90d97
fix(pipeline): nil-deref in ProcessSingle on multi-Del-per-uid + strip stale READING debug prints
Two bugs surfaced by graphql/e2e/auth's TestOrderAndOffset (cleanup
mutation \`mutation DelTask { deleteTask(filter: {}) }\` crashed the
alpha mid-request, causing the test client to see EOF on POST):
1. posting/index.go ProcessSingle SIGSEGV at line 675.
GraphQL deleteTask cleanup expands into multiple Del edges per
entity (one per predicate the entity has — uid, type, list edges,
etc.). When two Del edges to the same uid land in one transaction's
batch, the second iteration through ProcessSingle's per-edge loop
does:
pl, exists := postings[uid]
if exists {
if edge.Op == DEL {
oldVal = findSingleValueInPostingList(pl)
if string(edge.Value) == string(oldVal.Value) { ... }
^^^^^^ nil deref
}
}
findSingleValueInPostingList only returns Set postings; if the
accumulated list holds only Dels (from the prior iteration), it
returns nil and we panic dereferencing oldVal.Value.
Two fixes here:
- Guard the deref: \`if oldVal != nil && string(...) == ...\`.
- Move \`var oldVal *pb.Posting\` inside the loop. It was declared
at function scope, so a stale value from one edge could bleed
into the nil-guarded branch for a different uid on a later
iteration. Per-edge scope makes the intent explicit.
2. worker/task.go: two leftover \`fmt.Println("READING SINGLE", ...)\`
and \`fmt.Println("READING", ...)\` calls in the value-postings
read path. Same class of debug spew Phase 1B stripped from
posting/, missed because that sweep didn't include worker/.
Removed both. Safe — they were unconditional prints on every
query value read.
The graphql/e2e/auth and graphql/e2e/auth/debug_off packages now both
pass in 30s. \`./posting/\` and \`./worker/\` unit tests still green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8ccdae6 commit de90d97
2 files changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
638 | 637 | | |
639 | 638 | | |
640 | 639 | | |
| |||
644 | 643 | | |
645 | 644 | | |
646 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
647 | 649 | | |
648 | 650 | | |
649 | 651 | | |
| |||
671 | 673 | | |
672 | 674 | | |
673 | 675 | | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
674 | 681 | | |
675 | | - | |
| 682 | + | |
676 | 683 | | |
677 | 684 | | |
678 | 685 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
491 | | - | |
492 | 490 | | |
493 | 491 | | |
494 | 492 | | |
| |||
508 | 506 | | |
509 | 507 | | |
510 | 508 | | |
511 | | - | |
512 | | - | |
513 | 509 | | |
514 | 510 | | |
515 | 511 | | |
| |||
0 commit comments