Repository navigation
Optimize task startup by caching identity and credential data - #39
Conversation
|
Test it hard if it's working or not |
|
I've added an aggressive concurrency stress test ( |
…rent CredWriteW errors
|
[CI/CD Fix Attempt 1] Added in-memory caching and |
|
This branch has conflicts with merge. See what is the issue. Fix it |
|
I have pulled the latest changes from |
|
Check failed |
|
[CI/CD Fix Attempt 2] Fixed a compilation error on Windows targets in |
…d to fit CI quotas
|
I addressed the |
|
I have resolved the new merge conflict in |
Context & Objectives
Every agent task spawn previously triggered repeated external shell commands to verify identities, while credential access relied on synchronous disk I/O and global locks. These bottlenecks significantly throttled system throughput and increased task startup latency.
This PR introduces minimal, in-memory caching for system identifiers and secrets to eliminate redundant shell-outs and reduce blocking time during concurrent execution.
Key Changes
1. Linux Identity Caching (
security-engine)The system now uses a
OnceLock<Token>to store the Restricted UID and GID for thevesseluser.id -uandid -gare expensive when performed for every sandbox spawn. Since these identifiers are static for the duration of the process, aOnceLockensures the shell-out happens exactly once, drastically reducing the overhead of context spawning.2. Concurrent Credential Access (
nim-credentials)Replaced the coarse-grained
Mutex<()>with an in-memoryRwLock<Option<HashMap<String, String>>>.RwLock, we enable multiple agents to retrieve secrets simultaneously.0600permissions before the memory cache is updated.Impact & Success Metrics
idcommand overhead.idare reduced to a single execution per session.Constraints & Guardrails
0600) are enforced on all disk writes to maintain the security posture of the credential store.