fix(connection): check socket file existence in default_host(), not directory#725
fix(connection): check socket file existence in default_host(), not directory#725
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #725 +/- ##
=======================================
Coverage 68.79% 68.80%
=======================================
Files 46 46
Lines 30999 31000 +1
=======================================
+ Hits 21325 21327 +2
+ Misses 9674 9673 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
REV: fix(connection): check socket file existence in default_host(), not directoryVerdict: REQUEST CHANGES — the fix is directionally correct and the bug is real, but there are two issues worth addressing before merge. 1. Correctness: directory scan matches
|
| # | Issue | Severity |
|---|---|---|
| 1 | Lock file matches prefix, partial false-positive reintroduced | Medium |
| 2 | Scan matches wrong-port sockets | Medium |
| 3 | read_dir() more expensive than needed |
Low |
| 4 | Silent read_dir() error suppression |
OK |
| 5 | Doc comment backtick style | Nit |
| 6 | Version bump / CHANGELOG leak from PR #720 | Should fix |
The simplest fix for 1, 2, and 3 together: replace the read_dir() scan with a single path.join(".s.PGSQL.5432").exists() check (using the resolved port, or the default if not yet resolved).
8d0ee9a to
4187d38
Compare
4187d38 to
30f4149
Compare
Closes #721
Previously checked if the candidate socket directory existed. Now checks if the actual socket file (.s.PGSQL.) exists inside it, preventing false positives when the directory exists but no Postgres is running.