PDF extraction ignores the shutdown context (up to 5 min per PDF) ai:claude-sonnet-5-5 #48
Labels
No labels
nagonag
nagonag/ignore
bug
doc
duplicate
enhancement
help wanted
invalid
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
IUS/xr-invoiced#48
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by a 100 Go Mistakes review (#60/#61: context misuse). Verified by reading the code.
Where:
internal/xrechnung/pdf.go:30-35(ExtractEmbeddedXML),internal/xrechnung/detector.go(IsXRechnung,Walk).Problem:
ExtractEmbeddedXMLcreates its owncontext.WithTimeout(context.Background(), 5*time.Minute).IsXRechnung/Walktake noctx, so SIGTERM cannot interrupt a slow or hostile PDF; the daemon keeps parsing for up to 5 minutes per attachment before it can shut down.Fix: thread the caller's
ctxthroughWalk,IsXRechnungandExtractEmbeddedXMLand derive the timeout from it.(co)authored by ai:claude-sonnet-5-5