You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prints from ray remote are coming in a previous notebook cell #1370
Issue Description:
When using ray in a notebook, the prints from a ray future are coming in previous cell instead of the cell where the future is executed
To Reproduce
Refer minimal jupyter notebook example shown in the snapshot
Expected behavior
The prints from ray future should come in the cell where the future is executed
I've just figured out some hacky way to mitigate this issue.
In brief, use IPython Event hooks to generate a "logging background thread/coroutine" upon cell execution, and redirect Ray logs to that logging thread/coroutine just created in current cell.
It seems that after #1451 's release, Ray logs would display in the latest cell by default. Looking forward to this!
IPykernel 7.1.0 has been released with fix #1451. I think this should fix the problem here, it would be good to receive confirmation of this so we can close this issue.
IPykernel 7.1.0 has been released with fix #1451. I think this should fix the problem here, it would be good to receive confirmation of this so we can close this issue.
Activity
minrk commentedon Mar 7, 2025
I suspect you're hitting #1289, which has some more information. Unfortunately, there is no easy fix with a public API.
Clouder0 commentedon Oct 17, 2025
I've just figured out some hacky way to mitigate this issue.
In brief, use IPython Event hooks to generate a "logging background thread/coroutine" upon cell execution, and redirect Ray logs to that logging thread/coroutine just created in current cell.
It seems that after #1451 's release, Ray logs would display in the latest cell by default. Looking forward to this!
ianthomas23 commentedon Oct 27, 2025
IPykernel 7.1.0 has been released with fix #1451. I think this should fix the problem here, it would be good to receive confirmation of this so we can close this issue.
Clouder0 commentedon Oct 27, 2025
Fix confirmed for 7.1.0
ianthomas23 commentedon Oct 27, 2025
Thanks for the confirmation @Clouder0.
Closing this as fixed by #1451.