slaclab / pysmurf

Other
2 stars 9 forks source link

Adding timeout as an option to the underlying `epics.PV.get call` with 5 sec as default #781

Closed swh76 closed 1 year ago

swh76 commented 1 year ago

Description

Exposes epics.PV.get timeout option to smurf_command._caget and sets default to 5 sec. When we moved to PV caching in pysmurf release v7.2.0, we switched to querying registers using the epics.PV.get function which has a default 2 sec timeout instead of the epics.caget function we had been using previously which has a longer default 5 sec timeout. On some systems this resulted in timeouts. Resolves issue #780. Tested like this:

%timeit -r1 -n1 S._caget('xxx')
[ 2023-06-16 22:41:07 ]  Command failed: xxx
[ 2023-06-16 22:41:07 ]  Retry attempt 1 of 5
[ 2023-06-16 22:41:12 ]  Retry attempt 2 of 5
[ 2023-06-16 22:41:17 ]  Retry attempt 3 of 5
[ 2023-06-16 22:41:22 ]  Retry attempt 4 of 5
[ 2023-06-16 22:41:27 ]  Retry attempt 5 of 5