Python3 - Some of threads stop suddenly without any logs/messages

Viewed 97

I am working on a python project on Raspberry Pi. After the last release, some of our devices have a problem. Project includes two parts, camera and BLE. At first, these two parts were in seperate projects, they were running under different systemd services. In the latest release, I combined these two into one project. I am creating two processes using the multiprocess module and create threads under these processes. In the previous version, I was just creating threads and starting them. But now, some of the threads from the BLE part stuck at a point and stop working-without any error logs/messages. Especially BLE scan thread from the BLE process doing this. These two projects were running under two systemd services without a problem for a month. I could not figure out what is causing the problem.

I tried increasing the stack sizes of threads, cancelling the multiprocess part and using only threads as in the previous version but none of them was a solution. There is no major differences between versions, functions, modules, pip package versions are all the same. In the previous situation, one of the service running a 5-thread project and the other one running 10-thread project. Now I have one service running a python program includes 15-threads.

Platform: Raspbian Stretch -Raspbian Buster (both)

Python version: 3.5 (Stretch) - 3.7 (Buster) (both)

Important modules used in camera part: opencv-contrib-python(3.4.3.18), picamera(1.13)

Important modules used in BLE part: bluepy(1.3.0)

Feel free to ask further questions.

0 Answers
Related