-
Notifications
You must be signed in to change notification settings - Fork 39
usb/sagas: Retry USB device open on Linux if SecurityError occurs #2361
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
Conversation
814d85b to
f91242c
Compare
|
@laurensvalk, does this fix the issue for you? |
9ea524e to
576d9c4
Compare
On slow machines, udev rules may not have finished processing by the time we try to open the USB device. This causes a SecurityError, so we add a retry loop to handle this case. Closes: pybricks/support#2372
Add a step to upload the build artifact after building the project. This will make it easy for people to test it without having to build it themselves.
576d9c4 to
532852d
Compare
| - name: Set env to labs | ||
| run: | | ||
| echo "REACT_APP_NAME=Pybricks Labs" >> $GITHUB_ENV | ||
| echo "REACT_APP_SUFFIX=-labs" >> $GITHUB_ENV | ||
| echo "REACT_APP_VERSION=$GITHUB_SHA" >> $GITHUB_ENV | ||
| - run: yarn build | ||
| - uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: pybricks-labs | ||
| path: build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this something we would occasionally add for particular PRs that need testing? (Otherwise how do we handle more than one PR?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't automatically publish anywhere. It it just uploads the artifact to GitHub. One could download it and run it locally with serve.py to test a PR without having to build it themselves. Or we can throw it on labs.pybricks.com if we want wider testing.
Yes. Generally after the first
|
| continue; | ||
| } | ||
|
|
||
| // TODO: show error message to user here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make a issue/task for TODOs like these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want one issue per error message or one for all of them? I don't remember if we have an issue for this in general or not.
Fix a race condition where a response to a USB command could be missed if it arrives before the USB transferOut() call returns. This is done by using a channel to buffer incoming responses. Fixes: pybricks/support#2467
On slow machines, udev rules may not have finished processing by the time we try to open the USB device. This causes a SecurityError, so we add a retry loop to handle this case.
Closes: pybricks/support#2372