-
Notifications
You must be signed in to change notification settings - Fork 22
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
Put fails over ca #115
Comments
Oh, also, if you (@mrkraimer) are running straight from your fork, you probably need to apply this patch: a4e9730 |
This error means what it says. The PVStructure which is assigned to Can you visualize the difference between two Structures? eg. virtual void putBuild(const StructureConstPtr &build,
ClientChannel::PutCallback::Args& args) OVERRIDE FINAL
{
args.root = value;
args.tosend = tosend;
if(value->getStructure()!=build) {
std::cout<<"=== Structure mis-match\n===\n"<<*build<<"\n===\n"<<*value->getStructure()<<"\n===\n";
}
} |
The What this means in practice is that, rather than having a class member virtual void putBuild(const StructureConstPtr &build,
ClientChannel::PutCallback::Args& args) OVERRIDE FINAL
{
PVStructurePtr top(getPVCreate()->createStructure(build));
PVScalarPtr val(top->getSubFieldT<PVScalar>("value"));
val->putFrom(value);
args.tosend.set(val->getFieldOffset());
args.root = val;
} Also, please for the sake of sanity don't have more than one |
Also, notice the use of |
Hi @mdavidsaver, Please consider the piece of code I sent as a quick and dirty way to trigger the issue at hand. It is not representative of the actual code that I am developing (where namespaces are properly used and the Yes, the types are different. Here's
The actual issue is that I think |
Also, keep in mind this issue happens when @mrkraimer's fork is merged. The code as it is on the master branch doesn't trigger this issue. |
For Put/Get the pvac:: classes are a thin wrapper. Here you can see that aside from providing a default, a pvRequest is passed unchanged to pvAccessCPP/src/client/clientGet.cpp Lines 217 to 235 in 8644f42
On the other side you can see that the Structure passed to the builder comes directly from pvAccessCPP/src/client/clientGet.cpp Lines 89 to 93 in 8644f42
... error checking omitted pvAccessCPP/src/client/clientGet.cpp Lines 116 to 117 in 8644f42
This goes make me think of adding another "example" server, which would print pvRequest, value, and bitset from the put handler. |
In the original message Bruno said: Then the fix was commenting out the code:
But what a pvAccess server is required to do is to create a structure that has
For channel access
For ca provider,:
|
I understand the reasoning, but I believe that the current implementation is inconsistent, since Note that, in my example, while I expect the whole structure to be there, I only put to the So I think the correct thing to do (to ensure that only the |
Above it says What a pvAccess server is required to do is to create a structure that has
For a put channel access only allows the client to specify single field, i. e. the server only supports a single field. |
The |
These are not requirements as far as I'm concerned. The handling of pvRequest (or not) is left to individual ChannelProvider. caProvider may choose to do things this way, but others may not.
I think you really mean "QSRV"? For my own sanity, QSRV has only one Structure definition per PV for get/put/monitor irrespective of pvRequest. (so |
Yes. I meant that I get the whole structure when using
Here's my use case: I create a monitor on a PV. This monitor already has an underlying channel and an associated pvRequest. When I want to So, in the end, I believe Get, Put and Monitor operations should all operate on the same Structure for a given (pv, pvRequest) pair. Any restrictions on what can be the subject of |
Note that pvRequest is an argument to createGet, createPut, monitor,etc. Thus the API, which has existed since about 2007, means that the server can create different structures for get, put, monitor, etc. https://github.com/epics-base/pvAccessCPP/blob/master/src/client/pva/client.h I can see why Bruno came to his conclusion. Look at With pvaClient a get, put, etc is only created after a channel connects. |
Hi Marty, I understand what you are saying but my point was a little bit different. Please correct me if I am wrong in my following assertions: For the sake of argument, say that I create a monitor on the
I opened this issue because assertion 2.ii is false and I wish it was true. If I also think that 1.ii should be true, but that in particular doesn't hurt the client since it gets more data than it needs, not less data as is the case with 2.ii |
Hi Bruno, Doing a put over CA that tries to write anything except for the value field will never work; inside the IOC only the addressed field of the record (or Note that there is currently a significant disagreement between @mrkraimer and @mdavidsaver as to whether the CA model or the QSRV model is correct/better. @mdavidsaver 's implementation is simpler than @mrkraimer 's original vision of how this should work, but by using the same pvStructure for all get/put/monitor operations QSRV relies on the user knowing that they can't change a record's alarm status & severity say by doing a put that supplies data for the alarm structure. Michael explained above that for some cases like that there may be a warning, but in others the server silently discards the extra information. |
To be clear. When I looked yesterday I realized that I had only done so in the wait=true case. (Presumable where I first made this mistake) I intend to warn in all cases. |
What benefit is derived from doing otherwise? (I see none) |
Ok, so there one clear incompatibility between pva/client.h and caProvider. I assume that |
The way I see it, the
Presumably the IOC is the one that prevented the write in this case. Maybe What happens when channel access security is involved? Should In any case, I won't insist. If the current behavior is the correct one by design, then I'll have to work around it in the client. |
I wish it were so, but the PVA protocol wasn't designed this way. A prudent client will have to take into account the possibility that get/put/monitor may have different types.
This would be a reasonable interface. The issue at present is that the PVA protocol has no place for this granular information (another regrettable design issue). Let alone a way to communicate changes in permissions. |
Marty wrote:
To which Michael replied:
AIUI the idea was that the client can find out what the data structure from a channel will look like before it has to commit to even fetching any data from it. If the new API lets/makes a client create a put/get/monitor object before it knows what channel to connect to, how does the client find out what it's going to get from the channel? The kind of case I think we've always been concerned about is a client with limited RAM connecting by mistake to a PV that serves large image arrays. If the client can see in advance that this channel isn't going to return the kind of structure it wants it can avoid starting a channel monitor on it, thus saving both sides from problems. I don't know if the design completely achieved that goal (can a client limit how many array elements it will be sent?) but that was what we wanted. BTW: The terse mode output from pvget (
(I'm probably mixing up issues with that point, sorry!) |
For Put, this is the role of the For Get/RPC/Monitor, I didn't think this would ever be useful. The use case you mention seems like one better satisfied by adding a condition to the request (a la server side filters).
Not by any general mechanism. What the server wants to send is what the client gets.
Not surprising considering that I didn't test '-t'. The output modes of the pvtools need to be gone over. imo. there are too many ('-t', '-i', '-v'). |
@mdavidsaver Isn't a pvRequest like I agree about reviewing the pvtools, although I don't know who would do that or when it could happen. |
Only if I'm completely misunderstanding your use case of returning part, but not all of an array. I was thinking of something like
Yup. This sort of maintenance work doesn't really fit with my current feature driven funding. Looks boring on a slide, but high impact to those in daily contact with the tools. |
(Following discussion on #114)
I found the problem, and it is related to the ca provider. I can't create an issue on Marty's repository.
Proof of Concept:
https://github.com/brunoseivam/testPuthttps://gist.github.com/brunoseivam/7e861757d3bf1edf3e79dadd2dcd6affWhen running the test I get a
Provided put value with wrong type
, even though the provided type is supposed to match the server's type.If I comment these lines out, the test seems to work:
https://github.com/mrkraimer/pvAccessCPP/blob/df45c70149ec8f87bdea37f637b9ca4eea95100c/src/ca/dbdToPv.cpp#L148-L159
The text was updated successfully, but these errors were encountered: