Skip to content

[BUG] SAVE fully blocks the engine #11

Description

@Hogwarts-coder10

Location: commands.py — execute()'s with self._engine_lock: wraps every command including SAVE

Problem:

Every client (GET, SET, everything) queues behind the full json.dump() duration during SAVE. This is the Python equivalent of Redis without fork()/BGSAVE — there's no copy-on-write trick available here.

Fix (pick one):

Document it explicitly as a blocking operation (cheapest fix, valid for an educational project).
Or: snapshot a shallow copy of _data/_expires while holding the lock, release the lock, then do the actual disk I/O outside the lock. Reduces blocked time to the copy, not the write.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions