Skip to content

Commit fd4dfb7

Browse files
Copilotbbockelm
andcommitted
Address review feedback: remove unnecessary files and fix mutex limit handling
Co-authored-by: bbockelm <1093447+bbockelm@users.noreply.github.com>
1 parent 375f517 commit fd4dfb7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

_codeql_detected_source_root

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/scitokens_internal.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ std::shared_ptr<std::mutex> get_issuer_mutex(const std::string &issuer) {
6262
}
6363
}
6464

65-
// If still at capacity after cleanup, allow creating this new mutex anyway
66-
// The limit is a soft limit - we'll exceed it temporarily for active issuers
67-
// This is better than either blocking or aggressively clearing the cache
65+
// If still at capacity after cleanup, fail rather than unbounded growth
66+
if (issuer_mutexes.size() >= MAX_ISSUER_MUTEXES) {
67+
throw std::runtime_error("Too many concurrent issuers - resource exhaustion prevented");
68+
}
6869
}
6970

7071
auto mutex_ptr = std::make_shared<std::mutex>();

0 commit comments

Comments
 (0)