-
-
Notifications
You must be signed in to change notification settings - Fork 150
(hopefully) fix send on closed channel panic #621
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8ff92a3
to
ef1a696
Compare
ef1a696
to
eb32a1e
Compare
rsora
approved these changes
Mar 2, 2021
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.
👍
umbynos
added a commit
that referenced
this pull request
Mar 2, 2021
umbynos
added a commit
that referenced
this pull request
Aug 4, 2021
umbynos
added a commit
that referenced
this pull request
Aug 18, 2021
* update bufferflow_timedraw as bufferflow_timed * remove old commands * remove utf8 decoding with timedraw buffer type * binary support (WIP) * use switch case * fixed test deps * socketio test connection is working 🎉 (with the correct python-socketio version) * add callback to capture returned message, add new test for serial * fix tests: "socketio.exceptions.ConnectionError: Connection refused by the server" * minor optimizations: data and buf are already an array of bytes * enhanced a bit how the logic of the serial works * enhance a lot test on serial communication (with different buffer types) The tests should be skipped on the CI (no board connected) * update and enhance commands output (the space in front of `<` and `>` is required) 🤷♂️ * increased sleeptime, remove harcoded message[i]: should work on different systems * generalize the tests * Apply suggestions from code review Co-authored-by: per1234 <[email protected]> * add sketch used for testing * Fix panic closing closed channel * apply suggestions * Partially revert #e80400b7ddbbc2e8f34f1e6701b55102c3a99289 * 🧹(cleanup) and 🛠️(refactoring) of bufferflow stuff * extract code in helper function and uniform the code reintroduce the closing of input channel (it's required) * optimize the handling of data coming from the serial port * uniform default bufferflow and 🧹 * forgot to fix this in #621 * apply suggestions from code review ✨ * remove timedbinary: it's the same as timedraw except for the casting * Escape html commands string * forgot to remove timed_binary * remove useless id field (was unused) * remove useless channel done & other stuff * make sendNoBuf more general: will be used later 😏 * add `sendraw` command to send base64 encoded bytes, add tests (for send raw and for open/close port) * forgot to skip test_sendraw_serial on CI * update comments * refactor tests * remove BlockUntilReady because it was unused Co-authored-by: per1234 <[email protected]> Co-authored-by: Silvano Cerza <[email protected]>
umbynos
added a commit
that referenced
this pull request
Aug 18, 2021
* update bufferflow_timedraw as bufferflow_timed * remove old commands * remove utf8 decoding with timedraw buffer type * binary support (WIP) * use switch case * fixed test deps * socketio test connection is working 🎉 (with the correct python-socketio version) * add callback to capture returned message, add new test for serial * fix tests: "socketio.exceptions.ConnectionError: Connection refused by the server" * minor optimizations: data and buf are already an array of bytes * enhanced a bit how the logic of the serial works * enhance a lot test on serial communication (with different buffer types) The tests should be skipped on the CI (no board connected) * update and enhance commands output (the space in front of `<` and `>` is required) 🤷♂️ * increased sleeptime, remove harcoded message[i]: should work on different systems * generalize the tests * Apply suggestions from code review Co-authored-by: per1234 <[email protected]> * add sketch used for testing * Fix panic closing closed channel * apply suggestions * Partially revert #e80400b7ddbbc2e8f34f1e6701b55102c3a99289 * 🧹(cleanup) and 🛠️(refactoring) of bufferflow stuff * extract code in helper function and uniform the code reintroduce the closing of input channel (it's required) * optimize the handling of data coming from the serial port * uniform default bufferflow and 🧹 * forgot to fix this in #621 * apply suggestions from code review ✨ * remove timedbinary: it's the same as timedraw except for the casting * Escape html commands string * forgot to remove timed_binary * remove useless id field (was unused) * remove useless channel done & other stuff * make sendNoBuf more general: will be used later 😏 * add `sendraw` command to send base64 encoded bytes, add tests (for send raw and for open/close port) * forgot to skip test_sendraw_serial on CI * update comments * refactor tests * remove BlockUntilReady because it was unused Co-authored-by: per1234 <[email protected]> Co-authored-by: Silvano Cerza <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
before creating one)
bug fix
Sometimes the agent crashes with this panic when closing the serial panel on create:
The problem comes from the fact that Close function in
bufferflow_timed.go
could be called whenb.done
is already closed.Moving the close in the sender should solve the issue. Apparently is always possible to read from a closed channel, but writing causes a panic
no