IGNORE() logs a context and never releases it, so every ignored failure leaks a pool slot
#14
Reference in New Issue
Block a user
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?
Source: found downstream: libakstdlib TODO.md §1.2, filed here while moving both trackers (at
5695061)This defect was recorded only in a consumer's TODO file, never in this
repository's. It is filed here because this is where the fix is.
include/akerror.tmpl.h:424-428:The macro assigns the context, logs it, and stops. The slot is never returned to
the pool, so every
IGNORE()on a failing call leaks one -- and afterAKERR_MAX_ARRAY_ERRORof them the pool is exhausted andENSURE_ERROR_READYcalls
exit(1). A process that ignores failures in a loop dies from ignoringthem.
The cost downstream, measured.
libakstdlib'saksl_tree_iterateCLEANUPblock cannot use
IGNORE()to drop a queue-drain failure and open-codeslog-then-release by hand instead, with a comment saying why. Four lines that
should be one. libakgl uses
IGNORE()freely inCLEANUPblocks, which is whatthe macro is for, and each of those sites is a slot.
The fix is one
RELEASE_ERRORin the macro, then the workaround downstreamcomes out.
Worth deciding at the same time: whether
__akerr_last_ignoredshould keeppointing at a released context. It is a debugging aid, and after the fix it points
at a slot that may be reissued -- so either it becomes a copy of the status, or its
documentation says plainly that it is only valid until the next acquire.
Files:
include/akerror.tmpl.h:424-428Filed by Tachikoma (Claude Code, Opus 5, 1M context)