-
Notifications
You must be signed in to change notification settings - Fork 960
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
[Client] Read large dictionaries #2782
[Client] Read large dictionaries #2782
Conversation
…nd the relevant implementations. Added two unit tests, as well.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2782 +/- ##
==========================================
+ Coverage 54.73% 54.83% +0.10%
==========================================
Files 349 349
Lines 65975 66040 +65
Branches 13534 13546 +12
==========================================
+ Hits 36114 36216 +102
+ Misses 25939 25900 -39
- Partials 3922 3924 +2 ☔ View full report in Codecov by Sentry. |
} | ||
catch | ||
{ | ||
ExceptionDispatchInfo.Capture(ex).Throw(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this dispatchInfo for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ReadByteStringInChunks method is called from within a catch block. If it also fails with an exception the original exception is rethrown together with it's call stack information (which, to my knowledge, would be lost if I just throw it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imho this is not needed when immediately rethrowing like in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not rethrowing immediately. I'm rethrowing after executing ReadByteStringInChunks, which in turn can also throw an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the second throw; then ever executed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now confused. Does this become an aggregatedException?
|
||
int count = (int)ServerMaxByteStringLength; ; | ||
|
||
int my_MaxByteStringLength = m_configuration.TransportQuotas.MaxByteStringLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: quite an uncommen prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, since the new code is only used when the dictionary is too big, low risk.
Proposed changes
A new method is implemented which reads byte strings in chunks and therefore allows to read byte strings which exceed the encoding limits of the server. This is used in the method which reads v103 data dictionaries.
Related Issues
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that apply. You can also fill these out after creating the PR.Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
I have extended the ISession interface by a method
ReadByteStringInChunks
. Extending the interface may be considered a breaking change.The new method takes a node id as input (which must point to a valid byte string typed variable) and is supposed to return the byte string value from that node id, even if it is too large for the server to encode it. It is implemented in
Session
andTraceableSession
and used in theDataDictionary
class, when the Read call to read the byte string which contains the dictionary fails with a BadEncodingLimitsExceeded` Service Result Exception.(The method is currently intended to only fix the scenario in the bug mentioned. But as it is also exposed in the interface it could be used to read any byte string. The logic in that method is, in principal, also valid when reading other byte strings than data dictionaries or strings which are too large, or arrays which are too large).