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

PV gets timing out / saturating max # of tries in releases > v7.1.0 due to difference between epics.caget and epics.PV.get default timeout #780

Closed
swh76 opened this issue Jun 16, 2023 · 0 comments · Fixed by #781
Assignees
Labels
bug Something isn't working client Changes to the client code mustfix Must fix this. SLAC

Comments

@swh76
Copy link
Collaborator

swh76 commented Jun 16, 2023

Describe the bug

Users report register gets are timing out and saturating the max number of caget attempts in newer releases (>v7.1.0). This coincides with the change in v7.2.0 over to PV caching, and is apparently due to a subtle difference in the pyepics default timeout for register gets using epics.caget (which has a default timeout of 5 sec, and is what we used to use before PV caching) versus epics.PV.get (which is what we now use, but apparently has a default timeout of 2 sec).

Snippet for verifying in latest release v7.3.4;

In [3]: epics.__version__
Out[3]: '3.5.1'

In [4]: %timeit -r1 -n1 epics.caget('tmp')
cannot connect to tmp
5.01 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)

pv=epics.PV('tmp')
pv.get(count=1)
In [8]: %timeit -r1 -n1 pv.get(count=1)
2 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)

Will fix by adding timeout as an option to the underlying pysmurf _caget call with 5 sec default value. E.g.

# this should fix.
In [11]: %timeit -r1 -n1 pv.get(count=1,timeout=5)
5 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)
@swh76 swh76 added the bug Something isn't working label Jun 16, 2023
@swh76 swh76 self-assigned this Jun 16, 2023
@swh76 swh76 changed the title PV gets timing out / saturating max # of tries in releases > v7.1.0 due to difference between epics.caget and PV.get default timeout PV gets timing out / saturating max # of tries in releases > v7.1.0 due to difference between epics.caget and epics.PV.get default timeout Jun 16, 2023
@swh76 swh76 added client Changes to the client code mustfix Must fix this. SLAC labels Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client Changes to the client code mustfix Must fix this. SLAC
Projects
None yet
1 participant