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

[rosserial_python] Stop old thread before recreating new SerialClient #595

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

708yamaguchi
Copy link

@708yamaguchi 708yamaguchi commented Jul 18, 2022

In serial_node.py, when an "Unexpected Error" occurs, the client variable is recreated.
However, the write_thread thread used in the client variable is not released at that time.
This will increase the number of threads as "Unexpected Error" is repeated.

I checked the number of thread in serial_node.py with the following command.

import threading
threading.active_count()

If the number of threads exceeds the ulimit -u limit, no other processes can be launched.
For your reference, I share the error logs I am getting with my robot.

OpenBLAS blas_thread_init: pthread_create failed for thread 10 of 12: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 126864 current, 126864 max
thread.error: can't start new thread

https://gist.github.com/708yamaguchi/ff32e5921570e7e004836a758665acde

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

Successfully merging this pull request may close these issues.

1 participant