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

Make server extension verification call during extension startup non-blocking #480

Merged
merged 7 commits into from
Feb 9, 2024

Conversation

andrii-i
Copy link
Collaborator

@andrii-i andrii-i commented Feb 9, 2024

To test:

  1. Add a sleep statement like await asyncio.sleep(20) (20 seconds) to JobHandler.get as so:
class JobHandler(ExtensionHandlerMixin, JobHandlersMixin, APIHandler):
    @authenticated
    async def get(self, job_id=None):
        await asyncio.sleep(20)
        ...
  1. Launch the extension with and without this PR, note that with this PR startup is not blocked

@andrii-i andrii-i added the enhancement New feature or request label Feb 9, 2024
@andrii-i andrii-i changed the title Remove server extension verification async call from index.ts, make it synch Make server extension verification call in index.ts non-blocking Feb 9, 2024
@andrii-i andrii-i marked this pull request as ready for review February 9, 2024 17:42
@andrii-i andrii-i changed the title Make server extension verification call in index.ts non-blocking Make server extension verification call during extension startup non-blocking Feb 9, 2024
src/index.tsx Outdated Show resolved Hide resolved
src/index.tsx Outdated Show resolved Hide resolved
@andrii-i andrii-i added bug Something isn't working and removed enhancement New feature or request labels Feb 9, 2024
src/index.tsx Show resolved Hide resolved
@andrii-i andrii-i requested a review from bhadrip February 9, 2024 18:22
src/index.tsx Outdated Show resolved Hide resolved
src/index.tsx Show resolved Hide resolved
src/index.tsx Outdated Show resolved Hide resolved
src/index.tsx Show resolved Hide resolved
@andrii-i andrii-i requested a review from dlqqq February 9, 2024 20:02
Copy link
Collaborator

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -62,6 +62,7 @@
"@jupyterlab/coreutils": "^6",
"@jupyterlab/filebrowser": "^4",
"@jupyterlab/launcher": "^4",
"@jupyterlab/rendermime-interfaces": "^3.8.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work diving deep to find the exact minimum version of this package for JL4, after I gave you the wrong version range spec. 😂

When you backport this, you will want to change this to ^3.0.0:

https://github.com/jupyterlab/jupyterlab/blob/v3.0.0/packages/rendermime-interfaces/package.json

I know you already know, but I wanted to save you the time of looking that up ^

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @dlqqq

@andrii-i andrii-i merged commit 060011b into jupyter-server:main Feb 9, 2024
6 checks passed
@andrii-i andrii-i deleted the remove-async branch February 9, 2024 21:32
andrii-i added a commit to andrii-i/jupyter-scheduler that referenced this pull request Feb 9, 2024
…blocking (jupyter-server#480)

* remove async call, make call sync, refactor into a separate function

* don't use abbreviations in the verifyServerExtension function or type naming

* Update src/index.tsx

Co-authored-by: david qiu <[email protected]>

* remove unused type

* add @jupyterlab/rendermime-interfaces as a dependency

* Remove async from activatePlugin function declaration (makes it not async)

* set @jupyterlab/rendermime-interfaces version to ^3.8.0 to support all JLab >= 4

---------

Co-authored-by: david qiu <[email protected]>
andrii-i added a commit that referenced this pull request Feb 14, 2024
…p non-blocking (#480) (#481)

* Make server extension verification call during extension startup non-blocking (#480)

* remove async call, make call sync, refactor into a separate function

* don't use abbreviations in the verifyServerExtension function or type naming

* Update src/index.tsx

Co-authored-by: david qiu <[email protected]>

* remove unused type

* add @jupyterlab/rendermime-interfaces as a dependency

* Remove async from activatePlugin function declaration (makes it not async)

* set @jupyterlab/rendermime-interfaces version to ^3.8.0 to support all JLab >= 4

---------

Co-authored-by: david qiu <[email protected]>

* Fix translator usage, remove @jupyterlab/rendermime-interfaces dependency (#483)

* update snapshots

* use lowercase "es" is "es2017" as is convention in Project Jupyter

* fix 1.x dependencies

* fix package manifest to be compatible with JL3

* Make ErrorBoundary return JSX.Element to avoid type conflicts

---------

Co-authored-by: david qiu <[email protected]>
andrii-i added a commit to andrii-i/jupyter-scheduler that referenced this pull request Feb 15, 2024
…p non-blocking (jupyter-server#480) (jupyter-server#481)

* Make server extension verification call during extension startup non-blocking (jupyter-server#480)

* remove async call, make call sync, refactor into a separate function

* don't use abbreviations in the verifyServerExtension function or type naming

* Update src/index.tsx

Co-authored-by: david qiu <[email protected]>

* remove unused type

* add @jupyterlab/rendermime-interfaces as a dependency

* Remove async from activatePlugin function declaration (makes it not async)

* set @jupyterlab/rendermime-interfaces version to ^3.8.0 to support all JLab >= 4

---------

Co-authored-by: david qiu <[email protected]>

* Fix translator usage, remove @jupyterlab/rendermime-interfaces dependency (jupyter-server#483)

* update snapshots

* use lowercase "es" is "es2017" as is convention in Project Jupyter

* fix 1.x dependencies

* fix package manifest to be compatible with JL3

* Make ErrorBoundary return JSX.Element to avoid type conflicts

---------

Co-authored-by: david qiu <[email protected]>
andrii-i added a commit to andrii-i/jupyter-scheduler that referenced this pull request Feb 16, 2024
…p non-blocking (jupyter-server#480) (jupyter-server#481)

* Make server extension verification call during extension startup non-blocking (jupyter-server#480)

* remove async call, make call sync, refactor into a separate function

* don't use abbreviations in the verifyServerExtension function or type naming

* Update src/index.tsx

Co-authored-by: david qiu <[email protected]>

* remove unused type

* add @jupyterlab/rendermime-interfaces as a dependency

* Remove async from activatePlugin function declaration (makes it not async)

* set @jupyterlab/rendermime-interfaces version to ^3.8.0 to support all JLab >= 4

---------

Co-authored-by: david qiu <[email protected]>

* Fix translator usage, remove @jupyterlab/rendermime-interfaces dependency (jupyter-server#483)

* update snapshots

* use lowercase "es" is "es2017" as is convention in Project Jupyter

* fix 1.x dependencies

* fix package manifest to be compatible with JL3

* Make ErrorBoundary return JSX.Element to avoid type conflicts

---------

Co-authored-by: david qiu <[email protected]>
andrii-i added a commit that referenced this pull request Feb 16, 2024
…tup non-blocking (#480) (#486)

* [1.x] Make server extension verification call during extension startup non-blocking (#480) (#481)

* Make server extension verification call during extension startup non-blocking (#480)

* remove async call, make call sync, refactor into a separate function

* don't use abbreviations in the verifyServerExtension function or type naming

* Update src/index.tsx

Co-authored-by: david qiu <[email protected]>

* remove unused type

* add @jupyterlab/rendermime-interfaces as a dependency

* Remove async from activatePlugin function declaration (makes it not async)

* set @jupyterlab/rendermime-interfaces version to ^3.8.0 to support all JLab >= 4

---------

Co-authored-by: david qiu <[email protected]>

* Fix translator usage, remove @jupyterlab/rendermime-interfaces dependency (#483)

* update snapshots

* use lowercase "es" is "es2017" as is convention in Project Jupyter

* fix 1.x dependencies

* fix package manifest to be compatible with JL3

* Make ErrorBoundary return JSX.Element to avoid type conflicts

---------

Co-authored-by: david qiu <[email protected]>

* add pytest-cov dependency to pyproject.toml

* update pre-commit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: david qiu <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lab extension makes a blocking call to the server extension on startup
4 participants