ucall icon indicating copy to clipboard operation
ucall copied to clipboard

Bug: Server initialization sometimes fails on macOS

Open laclouis5 opened this issue 6 months ago • 1 comments

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?

  • [X] I have searched the existing issues

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

laclouis5 avatar Aug 06 '24 18:08 laclouis5