From e6e7afdd7577d46e2e6d65f81fc5bc3063411738 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Tue, 6 Sep 2022 15:42:45 +0200 Subject: [PATCH] core: clarify ACL token expiry GC messages to show global param. (#14466) --- nomad/core_sched.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nomad/core_sched.go b/nomad/core_sched.go index 9bf395720..132f3994b 100644 --- a/nomad/core_sched.go +++ b/nomad/core_sched.go @@ -817,7 +817,14 @@ func (c *CoreScheduler) expiredACLTokenGC(eval *structs.Evaluation, global bool) return nil } - expiryThresholdIdx := c.getThreshold(eval, "expired_acl_token", + // The object name is logged within the getThreshold function, therefore we + // want to be clear what token type this trigger is for. + tokenScope := "local" + if global { + tokenScope = "global" + } + + expiryThresholdIdx := c.getThreshold(eval, tokenScope+" expired ACL tokens", "acl_token_expiration_gc_threshold", c.srv.config.ACLTokenExpirationGCThreshold) expiredIter, err := c.snap.ACLTokensByExpired(global) @@ -874,7 +881,7 @@ func (c *CoreScheduler) expiredACLTokenGC(eval *structs.Evaluation, global bool) // garbage collection in environments with a high rate of token creation // and expiration. c.logger.Debug("expired ACL token GC found eligible tokens", - "num", len(expiredAccessorIDs)) + "num", len(expiredAccessorIDs), "global", global) // Set up and make the RPC request which will return any error performing // the deletion.