jdx/mise · error
executable identity cache contains too many entries
Error message
executable identity cache contains too many entries
What it means
store_executable_identity caps the in-memory identity cache at MAX_EXECUTABLE_IDENTITIES (64) entries. The cap is checked only when inserting a NEW key; overwriting an existing key never trips it.
Source
Thrown at crates/mise-cache-core/src/agent.rs:1713
.cloned();
Ok(AgentResponse::ExecutableIdentity { stdout })
}
fn store_executable_identity(
&self,
executable: PathBuf,
environment: BTreeMap<String, Option<String>>,
stdout: Vec<u8>,
) -> Result<AgentResponse> {
if stdout.len() > MAX_EXECUTABLE_IDENTITY_SIZE {
bail!("executable identity exceeds {MAX_EXECUTABLE_IDENTITY_SIZE} bytes");
}
let key = self.executable_identity_key(executable, environment)?;
let mut identities = self.executable_identities.lock().unwrap();
let is_new = !identities.contains_key(&key);
let previous_size = identities.get(&key).map_or(0, Vec::len);
if is_new && identities.len() >= MAX_EXECUTABLE_IDENTITIES {
bail!("executable identity cache contains too many entries");
}
let retained_bytes = identities.values().map(Vec::len).sum::<usize>();
if retained_bytes - previous_size + stdout.len() > MAX_EXECUTABLE_IDENTITY_BYTES {
bail!("executable identity cache contains too many bytes");
}
identities.insert(key, stdout.clone());
Ok(AgentResponse::ExecutableIdentity {
stdout: Some(stdout),
})
}
/// Serve newline-delimited protocol requests on an authenticated session stream.
pub async fn handle_connection<S>(&self, stream: S) -> Result<()>
where
S: AsyncRead + AsyncWrite + Unpin,
{
let (reader, mut writer) = tokio::io::split(stream);
let mut lines = BufReader::new(reader).lines();View on GitHub (pinned to 6f52dcdf99)
Solutions
- Limit probing to the few executables actually used for compilation
- Reuse one resolved toolchain per session instead of probing many paths
- Restart the session to reset the in-memory cache if it filled with one-off probes
Defensive patterns
Strategy: validation
Validate before calling
const MAX_IDENTITIES: usize = 64;
let mut probed: HashSet<ExecutableIdentityKey> = HashSet::new();
fn should_probe(probed: &HashSet<ExecutableIdentityKey>, key: &ExecutableIdentityKey) -> bool {
probed.contains(key) || probed.len() < MAX_IDENTITIES
} Prevention
- Resolve the toolchain once per session and probe only that executable
- Reuse stored identities for repeated lookups instead of re-probing variants
- Remember the cache is in-memory: a session restart clears it
When it happens
Trigger: A session probing 65+ distinct (executable, RUSTUP_*) identity combinations — e.g. many toolchain paths or rustup shims resolved to different binaries.
Common situations: Enumerating every binary in a toolchain dir; multi-toolchain workspaces probing rustc from many install roots in one session.
Related errors
- executable identity cache contains too many bytes
- executable identity contains an unsupported environment vari
- executable identity exceeds {MAX_EXECUTABLE_IDENTITY_SIZE} b
- task action manifest baseline was not loaded
- task action manifest is not canonical JSON
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/6463b1fcedcc2875.
Report an issue: GitHub.