-
Notifications
You must be signed in to change notification settings - Fork 22
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
Reference loop leaking TCP worker threads #190
Comments
This might be more appropriate at https://github.com/epics-base/pvAccessCPP, I admit. |
These are PVA or CA connections? What does the server report on the IOC say? |
These are PVA connections; the server report ( |
Ok. This seems to be easy enough to replicate.
Concurrently run for n in `seq 100`
do
pvmonitor cnt &
done Wait a bit then
On IOC exit I also see
|
I suspect an issue with join-able threads and ref-counting of |
Actually, it looks like ref-counting of I am able to capture the issue with RR. I see that for a leaked |
Ok... My being tired of untangling a seemingly unending stream of reference loops like this one played a major role in motivating me to write PVXS. So I'm going to prioritize work on PVXS over this issue. Someone else is welcomed to have a go. Looking for I will also look at making |
Looking again at this issue and epics-base/epics-base#390, I notice that some of the
|
QSRV2 in PVXS does not have this issue as it does not create dedicated thread(s) for each client. In general with PVXS I have tried to be stricter about resource ownership transfers through the user API. So ownership should be rooted in external objects, and situations like a worker thread holding the last reference to itself should not happen, even momentarily. Also, |
If you create an IOC with a single record, and then create and kill a large number of monitors on that record, then epicsThreadShowAll reveals a number of threads that no longer exist.
I am not getting 100% consistent numbers, but somewhere between 50--100 monitors on a given record will yield these "ghost" threads. Specifically, I run a number of
pvmonitor x
, wait 30 seconds, and then kill them all, and then runepicsThreadShowAll
in the IOC and I see something likeThe top threads are obviously expected, but the bottom ones are not. Moreover, they do not seem to exist according to the host OS: if you run
ps -T -C softIocPVA
then it does not list any of these threads once the monitors have been killed.If you repeat the process then the list simply gets longer each time.
This is EPICS base 7.0.7 on a CentOS7 VM.
The text was updated successfully, but these errors were encountered: