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

Fix pickle error when attempting to pickle an application which contains websocket routes #1853

Merged
merged 2 commits into from
Jun 28, 2020

Conversation

ashleysommer
Copy link
Member

Similar fix to PR #1842, this fixes the same problem but for websocket routes.
Moves the websocket_handler subfunction out to a class-level method, which can be more easily pickled by the built-in python Pickler.
Also includes a small addition of the same fix for the app.add_task() deferred task scheduler subfunction.

…ins websocket routes.

Moves the websocket_handler subfunction out to a class-level method, which can be more easily pickled by the built-in python Pickler.
Also includes a similar fix for the add_task deferred task scheduler subfunction.
@ashleysommer ashleysommer requested a review from Tronic May 14, 2020 14:15
@codecov
Copy link

codecov bot commented May 14, 2020

Codecov Report

Merging #1853 into master will increase coverage by 0.16%.
The diff coverage is 83.78%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1853      +/-   ##
==========================================
+ Coverage   91.63%   91.80%   +0.16%     
==========================================
  Files          27       27              
  Lines        3000     3000              
  Branches      545      544       -1     
==========================================
+ Hits         2749     2754       +5     
+ Misses        172      169       -3     
+ Partials       79       77       -2     
Impacted Files Coverage Δ
sanic/app.py 93.44% <83.33%> (+0.42%) ⬆️
sanic/server.py 75.00% <100.00%> (+0.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83511a0...956cdda. Read the comment docs.

@ahopkins ahopkins merged commit 761eef7 into sanic-org:master Jun 28, 2020
@ashleysommer
Copy link
Member Author

ashleysommer commented Jun 28, 2020

@ahopkins just a heads up, I don't think the one line change in server.py was supposed to be part of this fix, it might've been an accidental inclusion. I'll double check.

ashleysommer added a commit that referenced this pull request Jun 29, 2020
Revert change to multiprocessing mode accidentally included in #1853
ahopkins added a commit that referenced this pull request Jun 29, 2020
Revert change to multiprocessing mode accidentally included in #1853

Co-authored-by: Adam Hopkins <[email protected]>
ahopkins added a commit that referenced this pull request Jun 29, 2020
Revert change to multiprocessing mode accidentally included in #1853

Co-authored-by: Adam Hopkins <[email protected]>
@ahopkins
Copy link
Member

ahopkins commented Apr 7, 2021

This pull request has been mentioned on Sanic Community Discussion. There might be relevant details there:

https://community.sanicframework.org/t/multiprocessing-is-currently-not-supported-on-nt/827/2

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

Successfully merging this pull request may close these issues.

2 participants