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

Dependencies between operation limits and other quotas may conflict, and this may result in a BadEncodingLimitsExceeded SRE #2684

Open
1 of 5 tasks
ThomasNehring opened this issue Jul 25, 2024 · 0 comments
Labels
bug A bug was identified and should be fixed.

Comments

@ThomasNehring
Copy link
Contributor

ThomasNehring commented Jul 25, 2024

Type of issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Current Behavior

If the UA reference server sets its operation Limit MaxNodesPerRead to 65536, say, and the UA reference client sets its MaxArrayLength to a smaller value (65535, say), then calling, e.g., Session.ReadNodesAsync with sufficiently many nodes (about 50000) will result in an error in BinaryEncoder.WriteArrayLength (BadEncodingLimitsExceeded), since the number of nodes to be encoded equals MaxNodesPerRead while the Encoder wants to write an array of length at most MaxArrayLength.

Expected Behavior

Setting and working with such limits (esp. when they are distributed between client and server) should not result in an operation to fail.

Steps To Reproduce

See the Current Behavior section.

Environment

- OS:
- Environment:
- Runtime:
- Nuget Version:
- Component:
- Server:
- Client:

Anything else?

I think the interdependencies between the various quotas and limits should be analyzed, and then the implications should make their way into the implementation.

The example in this description shows that a transport quota on server side for the number of nodes per read request should be lowered for the clients session, if the client has configured quotas which may be violated as a consequence of using the server settings, e.g. when creating packages of limited size for service calls. It seems, e.g., that the MaxArrayLength on the client side must exceed all other perRequest quotes set in the client (either through client configuration or server configuration) to avoid that encoding limits are exceeded.

(Of course this issue can be fixes by adapting the configuration, but this assumes the user is able to figure out which settings lead to the issue, which is not that easy).

@mregen mregen added the bug A bug was identified and should be fixed. label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug was identified and should be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants