Commit d801bfa
committed
CRITICAL FIX: Prevent check-in failure from seat upgrade lock contention
Flight C3GDAI's check-in FAILED because the seat upgrade function
held browser_session._lock for 10+ minutes while navigating
www.southwest.com. When the check-in thread (24h before departure)
tried to acquire the lock, it was blocked. When it finally got the
lock, the browser was on www.southwest.com (not mobile.southwest.com),
causing fetch() to fail with status 0 (same-origin policy violation).
Three fixes:
1. CRITICAL: Check-in proximity guard (worker.py)
- attempt_seat_upgrades() now checks if ANY check-in is within
2 hours. If so, seat upgrades are PAUSED entirely.
- Check-in is always the jdholtz#1 priority. Seat upgrades can wait.
- Activity log shows: "Seat upgrades PAUSED: check-in for X in Y minutes"
2. HIGH: Fresh browser session before check-in (checkin_handler.py)
- 30 minutes before check-in, the handler now calls
browser_session.start() (not just ensure_alive())
- This creates a completely fresh browser on mobile.southwest.com
- Guarantees the browser is on the correct domain with fresh WAF
tokens, regardless of what seat upgrades did earlier
3. MEDIUM: Lock timeout in make_request (browser_session.py)
- Changed from blocking `with self._lock:` to timed acquisition
`self._lock.acquire(timeout=60)`
- If the lock can't be acquired within 60 seconds, logs a warning
and retries instead of blocking indefinitely
- Prevents check-in from being stuck waiting for seat upgrade forever
https://claude.ai/code/session_01XeexS9xn1dz8wb9K11MkpV1 parent 2e5a98b commit d801bfa
3 files changed
Lines changed: 35 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
244 | 252 | | |
| 253 | + | |
| 254 | + | |
245 | 255 | | |
246 | 256 | | |
247 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
142 | 144 | | |
143 | 145 | | |
144 | | - | |
| 146 | + | |
| 147 | + | |
145 | 148 | | |
| 149 | + | |
146 | 150 | | |
147 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
| 619 | + | |
| 620 | + | |
620 | 621 | | |
621 | | - | |
622 | 622 | | |
623 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
624 | 637 | | |
625 | 638 | | |
626 | 639 | | |
| |||
0 commit comments