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
Dji Tello Halt does not terminate all the related goroutines and may wait forever when it is called multiple times #793
Labels
Comments
On this topic, |
Hi @joeyberkovitz thanks for pointing this out. A PR would be great. Thanks! |
gen2thomas
pushed a commit
that referenced
this issue
Jun 11, 2023
gen2thomas
pushed a commit
to gen2thomas/gobot
that referenced
this issue
Jul 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(parent commit 27c76b4585807e829965ec6a4551cadc28f430fe)
I tried Dji Tello Driver and found the following two problem related to
Halt
method.If these are issues that need to be fixed, I’d like to make a pull request.
Problems
1. Halt stops only one of the three infinite loops.
The Driver runs the three infinite loops(*). However
Halt
stops only one of the three because:case <- d.doneCh: break…
is defined in two of the three.Halt
callsd.doneCh <- struct{}{}
only once.(*)
So, only one of the three infinite loops can read
d.doneCh
and stop.2. Halt may wait forever when it is called multiple times.
Simply because
Halt
is blocked byd.doneCh <- struct{}{}
, if we callHalt
after the driver has been halted, It blocked forever.My test case and bug fixes
Test case
The test cases below simulate the problems.
These two test methods don't stop.
(st-user@1ffc138)
Try fixing
I tried fixing the problems at the commit(st-user@8c5ac6f) by:
case <- d.doneCh: break…
in every infinite loops.d.doneCh <- struct{}{}
as many times as the running infinite loops.The text was updated successfully, but these errors were encountered: