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

Undefined Timestamp with ca-gateway >= R2-0-6-0 #35

Open
hhslepicka opened this issue Mar 17, 2021 · 5 comments
Open

Undefined Timestamp with ca-gateway >= R2-0-6-0 #35

hhslepicka opened this issue Mar 17, 2021 · 5 comments
Assignees

Comments

@hhslepicka
Copy link
Contributor

Bug Report

Recently at SLAC we started to notice some issues with the Archiver Appliance not properly archiving PVs.

When tracking it down we noticed that some PVs coming through the Gateway were reporting the timestamp as after the first time through the gateway.

We were running the latest from ca-gateway after an upgrade from 2.0.6.0.

Here is how it looks like:

$ EPICS_CA_SERVER_PORT=5124 caget -a KFE:TEST:HUGO:ENUM
KFE:TEST:HUGO:ENUM             <undefined> NO

I was able to isolate the issue once I moved back to 2.0.6.0 and cherry-picked every commit between 2.0.6 and 2.1.0 and testing on every change.
The commit that introduces the issue is this one: c6dc159

I am not very familiar with GDD and the ca-gateway but I am trying to investigate the root cause.

Please let me know if you have some insight or guidance or comments that could help me in finding a fix for it.
I understand if not since it is a change introduced more than 5 years ago. (I guess folks run some very old gateways =) ).

Thank you!

Steps to Reproduce

  • In a host start a simple IOC. In my case I am running one with softIoc -d static.db where static.db is:
record(mbbo, "KFE:TEST:HUGO:ENUM")
{
   field(ZRST, "YES")
   field(ZRVL, "0")
   field(ONST, "NO")
   field(ONVL, "1")
   field(TWST, "MAYBE")
   field(TWVL, "2")
   field(VAL,  "0")
   field(PINI, "YES")
}
record(ai, "KFE:TEST:HUGO:AI")
{
   field(VAL, "0.0")
   field(PREC, 3)
   field(PINI, "YES")
}
  • Start a ca-gateway running 2.0.6.0 allowing only the PVs from this IOC to pass and using a different port for clients to connect to it (in my case I chose 5124).

  • From another host, try to caget this PV with the -a option to fetch the whole timestamp information as well. Notice that it will work…

  • Run again caget with the -a option and it will still work.

  • Now upgrade the ca-gateway to 2.1.0 or greater and repeat the test above.

  • On the first caget it will work but on the second it will display the timestamp as undefined.

Note: camonitor will have the same effect in case you are monitoring from the second host and update the PV via the first. The monitor update will display the new value but undefined for the timestamp.

@hhslepicka
Copy link
Contributor Author

A little update …

If I make so that this condition (https://github.com/epics-extensions/ca-gateway/blob/master/src/gatePv.cc#L1558) is always true, all the problems are gone for timestamps.

If I apply the same "patch" to the latest version of the gateway everything seems to behave properly (at least for my uneducated brain).

By behave properly I mean it didn’t look odd to my tests which were:

I have not tested it with waveforms as they will require some changes on my simple database.

@ralphlange
Copy link
Contributor

Thanks. This is a better place than my inbox.
No bad intentions. (Only the best!) But I am pretty snowed in at this moment and may take a while to get to it.

@ralphlange
Copy link
Contributor

If you have some time: you could morph your manual test into a test of the built-in test suite (they are pretty similar). That would help avoiding regressions once it is fixed.

@hhslepicka
Copy link
Contributor Author

Sorry that I reached out directly.. I should have thought of opening an issue here in the first place but the brain was damaged from GDD and ca-gateway! 😄
Thank you for the reply!

@hhslepicka
Copy link
Contributor Author

I will give that a try and see if I can make the regression test cover this case.

@ralphlange ralphlange self-assigned this Sep 1, 2021
bhill-slac added a commit to bhill-slac/ca-gateway that referenced this issue May 13, 2022
Needed to demo undef timestamp bug in gateway >= R2-0-6-0
epics-extensions#35
bhill-slac added a commit to bhill-slac/ca-gateway that referenced this issue May 24, 2022
Needed to demo undef timestamp bug in gateway >= R2-0-6-0
epics-extensions#35
klauer pushed a commit to slac-epics/ca-gateway that referenced this issue Nov 14, 2023
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

No branches or pull requests

2 participants