You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@yunikorn.apache.org by "Dale Richardson (Jira)" <ji...@apache.org> on 2026/08/25 22:47:00 UTC

[jira] [Created] (YUNIKORN-3420) String() methods that take their own lock

Dale Richardson created YUNIKORN-3420:
-----------------------------------------

             Summary: String() methods that take their own lock
                 Key: YUNIKORN-3420
                 URL: https://issues.apache.org/jira/browse/YUNIKORN-3420
             Project: Apache YuniKorn
          Issue Type: Bug
          Components: core - common, core - scheduler
            Reporter: Dale Richardson


{{TrackedResource.String}}, {{Queue.String}}, {{Allocation.String}} (through {{GetAllocatedResource}} / {{IsAllocated}}) and {{Application.String}} (through {{GetSubmissionTime}}) take the read lock of the object they print. {{fmt}} and {{zap}} evaluate a {{Stringer}} whenever the log line is built, which the type does not control; if that happens while the caller holds the object's write lock, the goroutine deadlocks on itself.

No such caller was found in the current tree, so this is a trap rather than a bug that fires today. It is filed because a log line added under the write lock in future would hang silently, and because the fix is small.

Fix: print only fields fixed at construction ({{Application.String}}'s submission time already is), or have the caller take the snapshot under the lock and print that.

Marker: four {{+lockstringerignore}} sites carry this JIRA; the fix removes them.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: dev-help@yunikorn.apache.org