QuantConnect / lean-cli

CLI for running the LEAN engine locally and in the cloud
https://www.lean.io/cli
Apache License 2.0
195 stars 100 forks source link

C# research kernel idle infinitely #414

Open LouisSzeto opened 1 year ago

LouisSzeto commented 1 year ago

Right after connected to the jupyter, C# research notebook's Foundation-C#-default kernel went idle forever, and cannot be activated by running cells. Now, we can only restart with a new kernel instance and run all cells before its connection with the host to get the cells executed at the instance of connection.

LouisSzeto commented 1 year ago

Note:

  1. Jupyterlab version doesn't matter, version 3.2.1 to 3.4.4 have the same issue.
  2. Connection to docker container didn't end
  3. The below error message will pop up if running cells after it was disconnected:
    [W 2022-10-21 17:29:13.900 ServerApp] Nudge: attempt 10 on kernel {}
    [W 2022-10-21 17:29:18.926 ServerApp] Nudge: attempt 20 on kernel {}
    [W 2022-10-21 17:29:23.949 ServerApp] Nudge: attempt 30 on kernel {}
    [W 2022-10-21 17:29:28.973 ServerApp] Nudge: attempt 40 on kernel {}
    [W 2022-10-21 17:29:33.998 ServerApp] Nudge: attempt 50 on kernel {}
    [W 2022-10-21 17:29:39.021 ServerApp] Nudge: attempt 60 on kernel {}
    [W 2022-10-21 17:29:44.052 ServerApp] Nudge: attempt 70 on kernel {}
    [W 2022-10-21 17:29:49.079 ServerApp] Nudge: attempt 80 on kernel {}
    [W 2022-10-21 17:29:54.104 ServerApp] Nudge: attempt 90 on kernel {}
    [W 2022-10-21 17:29:59.127 ServerApp] Nudge: attempt 100 on kernel {}
    [W 2022-10-21 17:30:04.148 ServerApp] Nudge: attempt 110 on kernel {}
    [W 2022-10-21 17:30:09.172 ServerApp] Nudge: attempt 120 on kernel {}
    [E 2022-10-21 17:30:09.386 ServerApp] Uncaught exception GET
    /api/kernels/{abcabc}/channels?session_id={xyz} (172.18.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8080', method='GET',
    uri='/api/kernels/{abcabc}/channels?session_id={xyz}
    version='HTTP/1.1', remote_ip='172.18.0.1')
    Traceback (most recent call last):
      File "/opt/miniconda3/lib/python3.8/site-packages/tornado/websocket.py", line 956, in _accept_connection
        await open_result
    tornado.util.TimeoutError: Timeout
Martin-Molinero commented 1 year ago

This issue seems to have started since the py38 update at https://github.com/QuantConnect/Lean/pull/6558

Martin-Molinero commented 1 year ago

Reported bugs for jupyter lab & dotnet interactive

Martin-Molinero commented 1 year ago
Martin-Molinero commented 1 year ago

We could potentially make the lean CLI run the notebook with net in host mode to get around this issue

Sadly network host mode is only currently working for linux see https://github.com/docker/roadmap/issues/238