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

Possible mishandling of an obscure type #111

Open
jacomago opened this issue Jun 28, 2023 · 1 comment
Open

Possible mishandling of an obscure type #111

jacomago opened this issue Jun 28, 2023 · 1 comment

Comments

@jacomago
Copy link

Getting the error

jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: ERROR:p4p.gw:Error during periodic sweep
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: Traceback (most recent call last):
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: File "/opt/conda/envs/pva-gateway/lib/python3.7/site-packages/p4p/gw.py", line 723, in run
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: self.stats.update_stats(period)
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: File "/opt/conda/envs/pva-gateway/lib/python3.7/site-packages/p4p/gw.py", line 348, in update_stats
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: self.tbl_dsbyhosttx.post(C.execute('SELECT account, peer, tx as rate FROM dsbypeer ORDER BY rate DESC LIMIT 10'))
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: File "/opt/conda/envs/pva-gateway/lib/python3.7/site-packages/p4p/server/raw.py", line 162, in post
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: _SharedPV.post(self, self._wrap(value, **kws))
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: File "/opt/conda/envs/pva-gateway/lib/python3.7/site-packages/p4p/gw.py", line 72, in wrap
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: ret.value[k] = C
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: File "_p4p.pyx", line 192, in p4p._p4p._Value.__setitem__
jun 27 15:00:28 idmz-ro-epics-gw-tn.esss.lu.se pvagw[1019]: RuntimeError: Assign StringA from sequence of str|bytes, not int

I guess a PV could be lying about its type and is pushing out a integer instead.

@mdavidsaver
Copy link
Member

mdavidsaver commented Jun 29, 2023

https://github.com/mdavidsaver/p4p/blob/739b6eeef938f1eb889f243e4d898f1d7ae24677/src/p4p/gw.py#L71-L72

I guess a PV could be lying about its type and is pushing out a integer instead.

These are internal status PVs. The types are not user determined. Most likely this is a case of my changing something about value conversions in PVXS, and not realizing the effect on P4P due to incomplete test coverage.

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