Skip to content

Conversation

@ms-iankudinova
Copy link
Contributor

At the moment test server produces

Exception: System.IO.EndOfStreamException: Unexpected end of stream reached.
         at Bond.Protocols.Throw.EndOfStreamException()
         at Bond.IO.Safe.InputBuffer.EndOfStream(Int32 count)
         at Bond.IO.Safe.InputBuffer.ReadUInt8()
         at lambda_method(Closure , CompactBinaryReader`1 )
         at Bond.Deserializer`1.Deserialize[T](R reader)
         at Bond.Deserialize`1.From[R](R reader)
         at CommonSchema.Decoder.FromBondToJSONList(Boolean outputCompactJson, Boolean flatExt)

Even though Decoder.cs successfully read data and send successful response.

As I don't know better way to handle / detect that end of stream is reached and it seems that 1DS Test Server can keep processing request successfully, let's handle and log message for this exception (not stack trace). Then user won't see stacktrace and won't think that there is any error problem with Request or 1DS Test Server

outputBuffer.SetLength(0);
} while (true);
}
catch (EndOfStreamException)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the exception happening while reading the event from input buffer, and there is nothing to be read ? Just wondering if there is better way to avoid this exception.

Copy link
Contributor Author

@ms-iankudinova ms-iankudinova Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of infinity loop, after data was already read, it is tried to continue and read data from input buffer, but there is nothing to read.
Unfortunately, I couldn't find a way to check that there is nothing to read, and loop should finish.
Open to hear better solution 😄

Copy link
Contributor

@lalitb lalitb Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know a better way either, but giving it a thought, won't worry much as the decoder component is only used with test-server/fiddler. Should be fine :)

@ms-iankudinova ms-iankudinova merged commit a099d72 into main Nov 11, 2022
@ms-iankudinova ms-iankudinova deleted the user/iankudinova/hide_endofstreamexception branch November 11, 2022 10:19
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

Successfully merging this pull request may close these issues.

3 participants