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

Kernel not shut down on page reload in Firefox #528

Open
jtpio opened this issue Jan 27, 2020 · 14 comments
Open

Kernel not shut down on page reload in Firefox #528

jtpio opened this issue Jan 27, 2020 · 14 comments

Comments

@jtpio
Copy link
Member

jtpio commented Jan 27, 2020

Reloading the page in Firefox doesn't seem to be shutting the kernel down, while it does in Chrome. It is the same issue as the one mentioned in #55 (comment), but seems to be specific to Firefox at the moment.

Tested with:

  • Firefox Developer Edition 73.0b10
  • Firefox 72.0.1
  • Chromium 79
@vidartf
Copy link
Contributor

vidartf commented Jan 29, 2020

Does the network page of the developertools reveal any special caching?

@jtpio
Copy link
Member Author

jtpio commented Jan 29, 2020

Investigating this further. It looks like the cache is not involved, but instead it might be related to Adblock.

With Adblock enabled, the shutdown request doesn't show up in the network logs:

image

And with Adblock disabled, the shutdown request (DELETE) is logged:

image

With Chrome, the DELETE request is fired whether Adblock is enabled or not:

image

@jtpio
Copy link
Member Author

jtpio commented Jan 29, 2020

Moreover, the request doesn't show up in the Adblock tab in the dev tools. This might be because the page is reloaded and the list of blocked requests deleted.

Interestingly, whitelisting localhost doesn't let the DELETE request go through either.

@jtpio
Copy link
Member Author

jtpio commented Jan 29, 2020

It looks like it can be reproduced by enabling other browser extensions, such as HTTPS Everywhere (and disabling ad-blockers).

@vidartf
Copy link
Contributor

vidartf commented May 21, 2020

I'm looking into if it makes sense to start a ServiceWorker here for managing shutdown submissions. A short postMessage in onbeforeunload would hopefully be more reliable.

@vidartf
Copy link
Contributor

vidartf commented May 21, 2020

Or possibly sendBeacon ?

@jtpio
Copy link
Member Author

jtpio commented May 22, 2020

sendBeacon looks interesting and could be a substitute for what is currently in #612 (although it seems to be for POST requests only).

@maartenbreddels
Copy link
Member

Even better! Learning every day :) Thanks @vidartf !

@vidartf
Copy link
Contributor

vidartf commented May 22, 2020

The beacon sends an HTTP request via the POST method, with all relevant cookies available when called.

Good point @jtpio. 🤷

@jtpio
Copy link
Member Author

jtpio commented May 22, 2020

Maybe we would then need an extra voila POST endpoint for that specific purpose. Something like /voila/shutdown with the kernel id in the data (could be worth a try).

@vidartf
Copy link
Contributor

vidartf commented May 22, 2020

That would hopefully work, although the endpoint name suggest shutting down the server at the moment 😉 Maybe /api/voila/shutdown/{kernel_id} ?

@jtpio
Copy link
Member Author

jtpio commented May 22, 2020

For sure. Although in some way it still sounds like a workaround and a "duplicate" of the existing jupyter server shutdown endpoint?

@vidartf
Copy link
Contributor

vidartf commented May 22, 2020

It is definitely a workaround and duplicate. It might be that the XHTTP async=false is the best approach, as a DELETE request should not be too slow. The sendBeacon is probably more relevant to use when you actually need to transfer some amount of data that might lead to otherwise unreasonably slow behavior.

@vidartf
Copy link
Contributor

vidartf commented May 22, 2020

At least the sendBeacon docs outline what the alternatives are 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants