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

tornado 6 compatibility #4449

Merged
merged 9 commits into from
Mar 6, 2019
Merged

tornado 6 compatibility #4449

merged 9 commits into from
Mar 6, 2019

Conversation

minrk
Copy link
Member

@minrk minrk commented Mar 5, 2019

to get testing 6.0 again

We usually try to test prereleases to catch this kind of issue, but stopped testing tornado 6 when we found out about a compatibility problem. Whenever we merge a PR to pin dependencies as a band-aid to get tests passing (AOK to get things unblocked), let's try to open a WIP PR unpinning the dependency immediately so we can fix the issue, because it's always a real thing we need to fix, ideally with a release before the upstream package gets its final release.

once this works:

closes #4437
closes #4439

to get testing 6.0 again
for debugging test env
stream is None in tornado 6
tornado gen.maybe_future is deprecated in >= 5.0 and doesn't accept asyncio coroutine objects or awaitables in general
causing failures with tornado 6 on asyncio

monkeypatch gen.maybe_future for easier backport to 5.x

later, we can update to use our maybe_future throughout
@minrk minrk added this to the 5.7.5 milestone Mar 5, 2019
@minrk
Copy link
Member Author

minrk commented Mar 5, 2019

Can release 5.7.5 from 5.7.x after landing this

@minrk
Copy link
Member Author

minrk commented Mar 5, 2019

OK, I think this is ready to go and we can release 5.7.5 once it's backported.

@minrk
Copy link
Member Author

minrk commented Mar 5, 2019

I think it would be appropriate to pin tornado<7 in the 5.7.5 release, since we'll likely be making a 6.0 release with bigger changes before long which can be properly unpinned

@@ -172,7 +172,7 @@ def open(self, *args, **kwargs):

def send_ping(self):
"""send a ping to keep the websocket alive"""
if self.stream.closed() and self.ping_callback is not None:
if self.ws_connection is None and self.ping_callback is not None:
Copy link
Member

Choose a reason for hiding this comment

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

FWIW - I had found the similar change was necessary via ws_connection.

@@ -259,9 +258,9 @@ def gateway_request(endpoint, **kwargs):
except ConnectionRefusedError:
raise web.HTTPError(503, "Connection refused from Gateway server url '{}'. "
"Check to be sure the Gateway instance is running.".format(GatewayClient.instance().url))
except HTTPTimeoutError:
except HTTPError:
Copy link
Member

Choose a reason for hiding this comment

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

Thank you.

else:
import tornado.gen
tornado.gen.maybe_future = maybe_future

Copy link
Member

Choose a reason for hiding this comment

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

Very nice. I had also found that gen.maybe_future wasn't happy with tornado 6, this is a much more elegant solution for B/C purposes.

@kevin-bates
Copy link
Member

Thank you Min! FWIW - I pull your branch and took things for a quick spin against tornado 6.0.1. Looks good! 👍

@minrk minrk changed the title unpin tornado tornado 6 compatibility Mar 6, 2019
@minrk minrk merged commit e2ac757 into jupyter:master Mar 6, 2019
@minrk minrk deleted the unpin-tornado branch March 6, 2019 09:46
@lumberbot-app
Copy link

lumberbot-app bot commented Mar 6, 2019

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout 5.7.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 e2ac757821bc898ddfd0db5ba2b9da4f02ace931
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #4449: tornado 6 compatibility'
  1. Push to a named branch :
git push YOURFORK 5.7.x:auto-backport-of-pr-4449-on-5.7.x
  1. Create a PR against branch 5.7.x, I would have named this PR:

"Backport PR #4449 on branch 5.7.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

minrk added a commit to minrk/notebook that referenced this pull request Mar 6, 2019
minrk added a commit that referenced this pull request Mar 6, 2019
maartenbreddels added a commit to maartenbreddels/jupyter_server that referenced this pull request Mar 7, 2019
maartenbreddels added a commit to maartenbreddels/jupyter_server that referenced this pull request Mar 7, 2019
weiji14 added a commit to weiji14/deepbedmap that referenced this pull request Mar 17, 2019
Broken package problem mentioned at e6a3066 now resolved, and we can safely unpin tornado from the Pipfile. Actual resolve-ment may have had to do with notebook coincidentally being updated from 5.7.4 to 5.7.6 at 7e91dbc. See jupyter/notebook#4449 and jupyter/notebook#4439. To be honest, I can't quite remember if it's actually notebook that broke in the first place, might have been some DeprecationWarning in some other package being printed that broke one of the tests in test_ipynb.ipynb...
Zsailer pushed a commit to Zsailer/jupyter_server that referenced this pull request Sep 23, 2019
Zsailer pushed a commit to Zsailer/jupyter_server that referenced this pull request Sep 23, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants