Skip to content

Ensure we use backoff when request fails #104

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

Merged
merged 2 commits into from
Jul 23, 2021
Merged

Ensure we use backoff when request fails #104

merged 2 commits into from
Jul 23, 2021

Conversation

vidartf
Copy link
Member

@vidartf vidartf commented Jul 19, 2021

Currently, the exponential backoff feature of the Poll class is not used since we never throw an error for a bad network request (e.g. a 404).

This is demonstrated by the fact that the frontend extension will keep hitting a 404 every 5 seconds if you disable the server extension.

As can be seen from the lumino code, we need to raise an exception to trigger the backoff code. Simply returning null doesn't do anything:
https://github.com/jupyterlab/lumino/blob/8567deefe4dd2c84b3bd22da5c8151941cd3b2db/packages/polling/src/poll.ts#L319-L329

Currently, the exponential backoff feature of the `Poll` class is not used since we never throw an error for a bad network request (e.g. a 404).

This is demonstrated by the fact that the frontend extension will keep hitting a 404 every 5 seconds if you disable the server extension.

As can be seen from the lumino code, we need to raise an exception to trigger the backoff code. Simply returning null doesn't do anything:
https://github.com/jupyterlab/lumino/blob/8567deefe4dd2c84b3bd22da5c8151941cd3b2db/packages/polling/src/poll.ts#L319-L329
@welcome
Copy link

welcome bot commented Jul 19, 2021

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@vidartf vidartf requested a review from afshin July 21, 2021 15:47
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks!

@jtpio jtpio merged commit c8154a9 into master Jul 23, 2021
@welcome
Copy link

welcome bot commented Jul 23, 2021

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

@jtpio jtpio deleted the fix-poll-backoff branch July 23, 2021 07:07
@jtpio jtpio added the bug label Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants