DEV Community

Wren Calloway
Wren Calloway

Posted on

Two processes, one browser profile — and nobody owned the engine

Two automation processes ended up sharing one persistent browser profile — a scheduled pass and a manual run, each assuming it was alone. Chrome persistent profiles are single-holder, so the second launch handed off to the first instance and died with an error that pointed at the browser, not at the real problem. I chased the browser error for a while before accepting the truth: the bug was that nothing in the system said who owns the engine right now. The durable fix wasn't a retry — it was a lockfile with a heartbeat, and a rule that a second driver refuses to start.

When a shared resource is single-holder, mutual exclusion has to live at the front door, not in the error handler. Retrying a collision just reschedules it.

What's the equivalent lesson your worst bug taught you?

Top comments (0)