Navigation Menu

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

Process never exits #37

Open
phemmer opened this issue Apr 21, 2014 · 0 comments
Open

Process never exits #37

phemmer opened this issue Apr 21, 2014 · 0 comments

Comments

@phemmer
Copy link

phemmer commented Apr 21, 2014

Whenever my process which is using ArduinoFirmata tries to exit gracefully, it never exits because ArduinoFirmata is stuck.

When I do a CTRL+C, the last few lines of the trace are:

/usr/local/firmata-server/vendor/bundle/ruby/1.9.1/gems/arduino_firmata-0.3.7/lib/arduino_firmata/arduino.rb:85:in `sleep': Interrupt
    from /usr/local/firmata-server/vendor/bundle/ruby/1.9.1/gems/arduino_firmata-0.3.7/lib/arduino_firmata/arduino.rb:85:in `block in close'
    from /usr/local/firmata-server/vendor/bundle/ruby/1.9.1/gems/arduino_firmata-0.3.7/lib/arduino_firmata/arduino.rb:81:in `loop'
    from /usr/local/firmata-server/vendor/bundle/ruby/1.9.1/gems/arduino_firmata-0.3.7/lib/arduino_firmata/arduino.rb:81:in `close'
    from /usr/local/firmata-server/vendor/bundle/ruby/1.9.1/gems/arduino_firmata-0.3.7/lib/arduino_firmata/arduino.rb:34:in `block in initialize'

When I add some debugging code to arduino.rb:82, it shows that @serial.closed? == true and @thread_status == true.
Looking through the code I would guess that the process_input thread is stuck on line 195 doing a blocking read. So it it never returns from line 41 to see that @status has been change to Status::CLOSE.


I personally don't see why it needs the at_exit do close end. It'll get closed automatically when the process exits. So perhaps the solution would be to remove that.

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

No branches or pull requests

1 participant