fixed await issues#879
Open
kafkasl wants to merge 2 commits into
Open
Conversation
kafkasl
commented
May 20, 2026
| "outputs": [], | ||
| "source": [ | ||
| "# Run the notebook locally to see the HTMX iframe in action\n", | ||
| "HTMX()" |
Contributor
Author
There was a problem hiding this comment.
I have commented this because it is designed to be run locally only, and completely blocks solveit. Happy to revert if you disagree
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main goal of this PR is to fix some race conditions when calling
JupyUvi.stop. I often getaddress already busydespite doing something like:It also addresses sync/async interference during shutdown by splitting cleanly those classes and start/stop methods.
Issues
The main issues were:
localhostwhile uvicorn starts on0.0.0.0. Localhost interface can be free for biding "bindable" to a given port, while0.0.0.0(which requires ALL interfaces free) is still busy.listenability condition, not just socket creation.
All of this is explored and demonstrated with examples in this dialog https://share.solveit.pub/d/346001068041d03a6fd2c0b328473fa9
Sync vs Async interfaces
In addition, I personally was a bit confused by the sync / async options. So I refactored. I am happy to change this as it introduces some breaking changes in the interface.
The motivation was:
Mixing the two lead to another subtle bug:
nb_serve_asyncruns in the notebook loop, but it used a blocking sync stop path (time.sleepvsasyncio.sleep) which prevented the shutdown coroutine work from progressing thus blocking uvicorn's shutdown work.My solution was to split sync / async classes, and make the async.stop use
asyncio.sleep.Notes
There's some extra output changes in the notebook due to the recent changes in SolveIT output rendering, I assume that is fine, but happy to surgically remove them if it is a bother