04/09/2014
Hello,
I recently came across a situation where our OPC UA client received a Bad_TooManyOperations status code as a result for a read query which (seemingly) contained an array which was too long. This is in accord with the spec (rev 1.03, part V, section 5.10.2.3).
I don't know for sure, however, which kind of limit the client hit. From what I understand it probably is a MaxNodesPerRead limit in the OperationLimits.
I then tried to figure out which limit actually applies to the server and how I could derive it's value. I turned out that the server did not provide any information on this (the Server->ServerCapabilities->OperationLimits node does not exist) and also during connection creation the server did not provide any information in this direction. The only limits I could detect were limits on the message size (the read request was much smaller) and Buffer Size, as well as limits for continuation point.
Again, this is in accord with the spec which says that this kind of information is optional. Apart from that I could not find any hint in the specification which would suggest how to deal with such a case. Right now I see only two options:
i) make the size of array and/or the number of nodes per read (write, ....) request configurable for the client and tell the user to reduce the corresponding value if they encounter an (undocumented) Bad_TooManyOperations status code, and repeat by trial and error until it works
ii) at runtime, in the session, catch exceptions carrying that status code and do the trial and error at runtime behind the scenes.
Both approaches are not very pleasant from my point of view. Is there, possibly any other best practice for this?
TiA,
Thomas
I think only this option
ii) at runtime, in the session, catch exceptions carrying that status code and do the trial and error at runtime behind the scenes.
makes sense. You could check OperationLimits and use that as first choice; but even if supplied by the Server, there is not requirement that the Server always respects its own advertised OperationLimits. For example under load with limited RAM it may need to ignore or further reduce its limits.
1 Guest(s)