Sometimes a tab wedges: the browser’s sign-out call fails and the tab stays signed in. The pool still puts it back on the idle list, and the next customer borrows a tab that is signed in to someone else’s account.
One wedged tab prints every later customer’s invoice from the first customer’s account, which is a data leak, not a cosmetic bug. And a pool that only drops the wedged tab slowly runs out of tabs.
Reproduce
wedge(1), then print a for acme and b for globex on a pool of 2: b borrows tab 1 and prints as acme. It should print from a fresh tab, signed in as globex.
Acceptance criteria
- A tab whose sign-out fails is closed and never lent again.
- A closed tab no longer counts against size, so the pool can open a replacement when a job needs one.
- The host never has more than size tabs open, replacements included.
- Everything from the previous level still holds: reuse before opening, no tab when every tab is lent, portrait after every job.
Notes
- Each case prints one entry per step, joined by “ | ”, then the host’s counts, now including the tabs closed.
- signOut(tab) is the browser’s call: it signs the tab out and reports whether it could. The checker wedges tabs before a case with wedge(id).
- Keep the names and signatures; the checker calls them. Don’t edit the plumbing.