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

Running post_to_influxdb.py for a long period creates hundreds of zombie hcitool processes #69

Closed
zbrozek opened this issue Apr 24, 2019 · 4 comments
Assignees

Comments

@zbrozek
Copy link

zbrozek commented Apr 24, 2019

It also stops actually capturing and uploading data once this starts happening.

root 28948 0.0 0.3 7220 3216 pts/1 S+ Apr19 0:00 sudo -n hcitool lescan --duplicates
root 28955 0.1 0.0 2476 632 pts/1 S+ Apr19 11:05 hcitool lescan --duplicates
root 29302 0.0 0.3 7220 3420 pts/1 S+ Apr19 0:00 sudo -n hcitool lescan --duplicates
root 29308 0.1 0.0 2476 624 pts/1 S+ Apr19 11:22 hcitool lescan --duplicates
root 29384 0.0 0.3 7220 3332 pts/1 S+ Apr20 0:00 sudo -n hcitool lescan --duplicates
root 29391 0.1 0.0 2476 648 pts/1 S+ Apr20 10:29 hcitool lescan --duplicates
root 29406 0.0 0.3 7220 3332 pts/1 S+ Apr20 0:00 sudo -n hcitool lescan --duplicates
root 29413 0.1 0.0 2476 616 pts/1 S+ Apr20 8:43 hcitool lescan --duplicates
root 29642 0.0 0.3 7220 3416 pts/1 S+ Apr19 0:00 sudo -n hcitool lescan --duplicates
root 29649 0.1 0.0 2476 624 pts/1 S+ Apr19 11:27 hcitool lescan --duplicates
root 30432 0.0 0.3 7220 3416 pts/1 S+ Apr20 0:00 sudo -n hcitool lescan --duplicates
root 30438 0.1 0.0 2476 668 pts/1 S+ Apr20 9:08 hcitool lescan --duplicates
root 30466 0.0 0.3 7220 3216 pts/1 S+ Apr20 0:00 sudo -n hcitool lescan --duplicates
root 30473 0.1 0.0 2476 656 pts/1 S+ Apr20 8:37 hcitool lescan --duplicates
root 30576 0.0 0.3 7220 3320 pts/1 S+ Apr20 0:00 sudo -n hcitool lescan --duplicates
root 30583 0.1 0.0 2476 624 pts/1 S+ Apr20 9:12 hcitool lescan --duplicates
root 30700 0.0 0.3 7220 3420 pts/1 S+ Apr20 0:00 sudo -n hcitool lescan --duplicates
root 30707 0.1 0.0 2476 636 pts/1 S+ Apr20 9:02 hcitool lescan --duplicates
root 31163 0.0 0.3 7220 3436 pts/1 S+ Apr19 0:00 sudo -n hcitool lescan --duplicates
root 31171 0.1 0.0 2476 656 pts/1 S+ Apr19 11:03 hcitool lescan --duplicates
root 31322 0.0 0.3 7220 3348 pts/1 S+ Apr20 0:00 sudo -n hcitool lescan --duplicates
root 31329 0.1 0.0 2476 616 pts/1 S+ Apr20 10:39 hcitool lescan --duplicates
root 31853 0.0 0.3 7220 3436 pts/1 S+ Apr23 0:00 sudo -n hcitool lescan --duplicates
root 31860 0.0 0.0 2476 624 pts/1 S+ Apr23 0:14 hcitool lescan --duplicates
root 31930 0.0 0.3 7220 3320 pts/1 S+ Apr21 0:00 sudo -n hcitool lescan --duplicates
root 31935 0.1 0.0 2476 620 pts/1 S+ Apr21 8:08 hcitool lescan --duplicates
root 31998 0.0 0.3 7220 3204 pts/1 S+ Apr23 0:00 sudo -n hcitool lescan --duplicates
root 32005 0.1 0.0 2476 668 pts/1 S+ Apr23 2:10 hcitool lescan --duplicates
root 32276 0.0 0.3 7220 3364 pts/1 S+ Apr21 0:00 sudo -n hcitool lescan --duplicates
root 32283 0.1 0.0 2476 620 pts/1 S+ Apr21 6:07 hcitool lescan --duplicates
root 32712 0.0 0.3 7220 3340 pts/1 S+ Apr21 0:00 sudo -n hcitool lescan --duplicates
root 32718 0.1 0.0 2476 660 pts/1 S+ Apr21 8:25 hcitool lescan --duplicates

@ttu
Copy link
Owner

ttu commented Apr 24, 2019

There must be something wrong with killing hcitool process
https://github.com/ttu/ruuvitag-sensor/blob/master/ruuvitag_sensor/ble_communication.py#L90

Any ideas?

@zbrozek
Copy link
Author

zbrozek commented May 4, 2019

Possibly? But how would I find out? It doesn't look like errors are propagated anywhere. Maybe the stored PID is wrong?

@ttu ttu added in progress and removed question labels May 22, 2019
@ttu ttu self-assigned this May 22, 2019
@ttu
Copy link
Owner

ttu commented May 22, 2019

Will make a fix for hcitool process killing

@ttu
Copy link
Owner

ttu commented May 30, 2019

Fixed hcitool subprocess closing (5deed32).

Also updated the https://github.com/ttu/ruuvitag-sensor/blob/master/examples/post_to_influxdb.py code. For long running processes should use RuuvitagSensors.get_datas-method as it won't start a new BLE scanning subprocess with each method call.

@ttu ttu closed this as completed May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants