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

Bug: Server initialization sometimes fails on macOS #107

Open
2 tasks done
laclouis5 opened this issue Aug 6, 2024 · 1 comment
Open
2 tasks done

Bug: Server initialization sometimes fails on macOS #107

laclouis5 opened this issue Aug 6, 2024 · 1 comment
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@laclouis5
Copy link

Describe the bug

When restarting a server rapidly after stopping it, it usually fails with this error:

Traceback (most recent call last):
    server = Server()
             ^^^^^^^^
    self.server = ucall.Server(**kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Server Initialization

Steps to reproduce

Setup a simple server (using Python):

from ucall.rich_posix import Server

server = Server()


@server
def test(name: str) -> str:
    return f"Hello, {name}!"


def main():
    server.run()


if __name__ == "__main__":
    main()

Run it (let's call the file api.py):

python api.py

In a new shell issue a request to the API:

ucall test name=Louis --uri 0.0.0.0 --port 8545

After the response control+C the server to quit it, then try to restart the server using the same command as above. This fails with the aforementioned error during around 5 to 10 seconds.

Expected behavior

Server restart should not fail.

UCall version

v0.5.4

Operating System

macOS Sonoma 14.5

Hardware architecture

Arm

Which interface are you using?

Official Python bindings

Which implementation are you using?

POSIX

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@laclouis5 laclouis5 added bug Something isn't working invalid This doesn't seem right labels Aug 6, 2024
@ashvardanian
Copy link
Collaborator

It may be the case that the port is not being reclaimed in time. The v1 of UCall will have a drastically different design and set of capabilities. Hopefully this will be resolved along the way. Thank you for reporting, @laclouis5 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants