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

Latest release --autoreload, keep getting "KeyboardInterrupt" errors #1984

Closed
pascalwhoop opened this issue Jul 17, 2024 · 4 comments
Closed
Assignees

Comments

@pascalwhoop
Copy link
Contributor

Description

Using kedro viz run --autoreload, when updating code I get errors, making autoreload unusable

kedro viz run --autoreload                                                                                                                                                         2.7m
Starting Kedro Viz ...
Kedro Viz started successfully.

✨ Kedro Viz is running at
 http://127.0.0.1:4141/
Process SpawnProcess-1:1:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/pascalwhoop/Code/everycure/matrix/pipelines/matrix/.venv/lib/python3.11/site-packages/kedro_viz/server.py", line 139, in run_server
    uvicorn.run(app, host=host, port=port, log_config=None)
  File "/Users/pascalwhoop/Code/everycure/matrix/pipelines/matrix/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 575, in run
    server.run()
  File "/Users/pascalwhoop/Code/everycure/matrix/pipelines/matrix/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 123, in run
    raise KeyboardInterrupt()
KeyboardInterrupt
^CException ignored in atexit callback: <function _exit_function at 0x107141da0>
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/util.py", line 360, in _exit_function
    p.join()
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 149, in join
    res = self._popen.wait(timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/popen_fork.py", line 43, in wait
    return self.poll(os.WNOHANG if timeout == 0.0 else 0)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/popen_fork.py", line 27, in poll
    pid, sts = os.waitpid(self.pid, flag)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^

Your Environment

Include as many relevant details as possible about the environment you experienced the bug in:

  • Chrome/MacOS/python3.12/
kedro==0.19.6
kedro-datasets==4.0.0
kedro-telemetry==0.5.0
kedro-viz==9.1.0
@astrojuanlu
Copy link
Member

Thanks @pascalwhoop for reporting this, we'll add this to our back log and have a look soon.

@astrojuanlu astrojuanlu moved this to Backlog in Kedro-Viz Jul 21, 2024
@rashidakanchwala
Copy link
Contributor

@pascalwhoop -- just want to confirm that in previous releases of Kedro-Viz, u didn't encounter this issue ? So if you go back to release 9.0.0, you don't face it?

@pascalwhoop
Copy link
Contributor Author

I haven't tested older versions

@rashidakanchwala rashidakanchwala moved this from Backlog to Inbox in Kedro-Viz Jul 29, 2024
@rashidakanchwala rashidakanchwala moved this from Inbox to Backlog in Kedro-Viz Sep 9, 2024
@rashidakanchwala rashidakanchwala moved this from Backlog to Todo in Kedro-Viz Sep 16, 2024
@SajidAlamQB
Copy link
Contributor

Hey, after some digging, I found that this issue doesn’t occur for kedro-viz >= 9.2.0. The reason I believe this happens in earlier versions, like 9.1.0, is due to a bug in Uvicorn 0.29.0.

In Kedro-Viz 9.2.0, Uvicorn was upgraded from uvicorn[standard]~=0.29.0 to uvicorn[standard]>=0.30.0. Version 0.30.0 of Uvicorn has some new multiprocess manager and improved signal handling, which likely resolved the "KeyboardInterrupt" errors during --autoreload. See their release-notes.

Upgrading Kedro-Viz to >=9.2.0 should resolve the problem.

@SajidAlamQB SajidAlamQB self-assigned this Sep 26, 2024
@rashidakanchwala rashidakanchwala moved this from In Review to Done in Kedro-Viz Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants