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

repeated put followed by get can fail #70

Open
mrkraimer opened this issue Feb 19, 2021 · 7 comments
Open

repeated put followed by get can fail #70

mrkraimer opened this issue Feb 19, 2021 · 7 comments

Comments

@mrkraimer
Copy link
Contributor

If a client does a put to multiple channels followed by a get to that same channels the gets do not always get the same value that was put.

The problem occurs with with both pvaClient and pvaClientMultiChannel.
Sinisa reported the problem for pvaClientMultiChannel.

Two tests were added to exampleClient/testClient: testNTMultiPutGet and testPutGet.
These demonstrate the problem.
If they are run against a single channel both report no errors.
As soon as more than one channel is specified both report errors.

@mrkraimer
Copy link
Contributor Author

I still do not have a solution to this problem but I think it is caused by race conditions related to how event.h is being used.
I have pushed changes to branch pvaClientMultiChannel_changes.
I did this so that I will not lose changes I know should be made before I pursue this further.

I also made changes to exampleClient.
There are now tests in exampleClient/testMultiplePutGet.
It tests that replace what was in exampleClient/testClient: testNTMultiPutGet and testPutGet..
Note that the only test that looks like to works every time is exampleClient/testMultiplePutGet/pvaPutGet
This test does not use pvaClient. It only uses pvAccess.
BUT it also does not use event.h. It sleeps until requests complete. Thus NOT a good solution.

@mrkraimer
Copy link
Contributor Author

In exampleClient/testMultiplePutGet, I renamed pvaPutGet to pvaPutGetSleep.
I then added pvaPutGetMutex. I pushed the changes.

Both look they work successfully every time.
So now I think I now have a good way to tackle the problems in pvaClientCPP.

But I may not get a chance to work on it until day after tomorrow.

mrkraimer added a commit that referenced this issue Feb 26, 2021
1) Fix issues #66 and #70
2) All tests in exampleCPP/testMultiplePutGet now work successfully.

I still want to do more testing, especially on connection management.
Also relese notes and documentation needs work.
@mrkraimer
Copy link
Contributor Author

I made quite a few changes.
See latest commit on branch pvaClientMultiChannel_changes.
Note that exampleCPP has also been updated.
Now all tests in exampleCPP/testMultiplePutGet work successfully.
I am now going to do more testing on connection management and then work on release notes and documentation.

As far as I know I have not broken any existing client code unless the client called methods that are now protected.

@anjohnson
Copy link
Member

Hi Marty, the exampleCPP builds on Jenkins have been failing for several days. I haven't checked the logs in detail, but this error appears on the RHEL6 and RHEL7 builds:

../multiPutDouble.cpp: In function 'int main(int, char**)':
../multiPutDouble.cpp:140: error: 'stod' is not a member of 'std'

I think your updates may have assumed a newer version of the C++ compiler than we have on those targets. The API is different but the epicsStdlib.h header defines a couple of routines that might work instead, or maybe strtod()?

I just stopped using make -j4 for the Windows builds to make it easier to find the error and they both fail with this:

c:\jenkins\win64-2\workspace\3.15-example-win64\testmultipleputget\src\pvaputgetsleep.cpp(13): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

Base provides an osiUnistd.h header which is designed to replace unistd.h and is available on all our targets, please try that instead.

@mrkraimer
Copy link
Contributor Author

mrkraimer commented Feb 27, 2021 via email

@anjohnson
Copy link
Member

osiUnistd.h gets installed into the include/os/<os-class> directory which is also in the compiler's include path. This allows a single Base installation to be shared by multiple OSs where the file's contents have to be different:

woz$ ls include/os/Darwin/
epicsAtomicOSD.h	osdInterrupt.h		osdThread.h
epicsGetopt.h		osdMessageQueue.h	osdTime.h
epicsMMIO.h		osdMutex.h		osdVME.h
epicsMMIODef.h		osdPoolStatus.h		osdWireConfig.h
epicsMath.h		osdSock.h		osdWireFormat.h
osdEvent.h		osdStrtod.h		osiUnistd.h

@mrkraimer
Copy link
Contributor Author

I just pushed changes to branch pvaClientMultiChannel_changes.
I think I am getting near ready to merge.

Andrew,
The test related code made exampleCPP harder to understand.
I moved the test related code from exampleCPP to
https://github.com/mrkraimer/testClientCPP

This had a side effect of getting rid of the exampleCPP builds on Jenkins failing.

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