Skip to content

Temporary fix for 8.0.0-beta6: Blocking connection/socket when using Chrome #32

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

Closed
wants to merge 1 commit into from
Closed

Temporary fix for 8.0.0-beta6: Blocking connection/socket when using Chrome #32

wants to merge 1 commit into from

Conversation

michalpokusa
Copy link
Contributor

@michalpokusa michalpokusa commented Jan 9, 2023

Experimental change in HTTPServer.poll() that fixes blocked connection from Chrome on CircuitPython 8.0.0

Fixes #31

EDIT 1: This is a workaround fix that should be used only on 8.0.0-beta6. When 8.0.0-beta7 or 8.0.0 is released this PR should be closed.

@michalpokusa
Copy link
Contributor Author

michalpokusa commented Jan 10, 2023

Unfortunately this does not work in CircuitPython 7.3.3, pooler.pool() raises OSError: stream operation not supported.

Although it can be written in a way that the pooler runs only on CP 8.x.x with a simple if statement, I don't really believe it is a way to go.

Additionally even in select library docs it says that this functionality is not supported on all CP builds.
image

Right now, this lib is not working properly on CP 8.0.0beta6, so wraping this code in try...except... might be a good temporary solution, until the underlaying error in CP's 8.0.0 socketpool (adafruit/circuitpython#7431) is resolved.

@dhalbert
Copy link
Contributor

I think the underlying problem that makes this fix needed is fixed by adafruit/circuitpython#7455. @michalpokusa Do you think this is useful anyway, or is it only needed as a workaround?

@michalpokusa
Copy link
Contributor Author

michalpokusa commented Jan 15, 2023

I think the underlying problem that makes this fix needed is fixed by adafruit/circuitpython#7455. @michalpokusa Do you think this is useful anyway, or is it only needed as a workaround?

Seems that PR to CP indeed fixes the blocking socket issue.

This PR was an experimental workaround to make this lib work on 8.0.0-beta6, but it had some issues connected to select module on 7.3.3.

In my opinion it is somewhat useful until your changes are merged and released under e.g. 8.0.0-beta7 as some people might still have problem and this PR might help them solve it.
After that it should be closed as no longer needed.

I changed the title and description to make it more verbose for people that might be looking for the fix.

@michalpokusa michalpokusa changed the title Fix: Polling for socket before receiving to prevent blocked connection from Chrome Temporary fix for 8.0.0-beta6: Blocking connection/socket when using Chrome Jan 15, 2023
@FoamyGuy
Copy link
Contributor

FoamyGuy commented Feb 6, 2023

8.0.0-rc.1 and now 8.0.0 stable have been released so this can be close now I think.

@FoamyGuy FoamyGuy closed this Feb 6, 2023
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.

HTTP Requests from Chrome block the server
3 participants