Skip to content

Commit

Permalink
Delete old .s.EDGEDB.admin.XXX sockets (#8248)
Browse files Browse the repository at this point in the history
This will make sure we can create the fallback symlink
even if an old socket wasn't deleted, which should fix
geldata/gel-cli#1418.

(Though maybe we want a CLI-side fix *also*, so 6.0b2 works better?)
  • Loading branch information
msullivan authored Jan 23, 2025
1 parent 722eb03 commit 097ab76
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion edb/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,17 @@ async def _start_admin_server(
self._runstate_dir, f'.s.GEL.admin.{port}')
symlink = os.path.join(
self._runstate_dir, f'.s.EDGEDB.admin.{port}')
if not os.path.exists(symlink):

exists = False
try:
mode = os.lstat(symlink).st_mode
if stat.S_ISSOCK(mode):
os.unlink(symlink)
else:
exists = True
except FileNotFoundError:
pass
if not exists:
os.symlink(admin_unix_sock_path, symlink)

assert len(admin_unix_sock_path) <= (
Expand Down

0 comments on commit 097ab76

Please sign in to comment.