Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic socket listening/accepting on Zed service port causes hang #4824

Open
philrz opened this issue Oct 25, 2023 · 0 comments
Open

Generic socket listening/accepting on Zed service port causes hang #4824

philrz opened this issue Oct 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Oct 25, 2023

Repro is with Zed commit 88f40ed and was uncovered during a PR review for a docs update.

Start this simple program that listens on a socket, accepts an incoming connection, and does no more.

$ cat mysocket.py 
#!/usr/local/bin/python3
import socket
import sys

if (len(sys.argv) != 2 or not sys.argv[1].isdigit()):
  print('Usage: listen <port>')
  exit()

p = int(sys.argv[1])
l = []
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', p))
s.listen(1)
while 1:
  (c, a) = s.accept()
  l.append(c)
  print('%d: connection from %s' % (len(l), a))

$ python3 mysocket.py 9867

At this point if I run a command like zed ls, it seems the logic for locating the lake gets to the step 3 listed there and hangs forever.

When I described this to @nwt, he responded that it's a bug. Not sure what he had in mind (e.g., more of an app-level check that it's actual Zed API endpoint that's listening, and/or maybe a timeout?) but I'm open to improvements!

@philrz philrz added the bug Something isn't working label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant