-
Notifications
You must be signed in to change notification settings - Fork 849
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
Encapsulated StreamResetException as IllegalStateException unhandled by the SDK #6946
Comments
Hi @celikrecep any idea where this stack trace is coming from? Its not part of Also, can you share some of the logs surrounding that stack trace? My current read of the source code leads me to believe that this exception occurred but could be a normal / expected part of transmitting data with unreliable networks. The additional logs could indicate what happened as a result of this exception. My best guess based on the source code is that an attempt to export spans failed, and this exception stack trace is just explaining why. |
appears to originate from the FullStory SDK. You can find their documentation here: FullStory Android SDK. It’s worth noting that FullStory has been integrated into our app for a long time; it was not recently added. Unfortunately, we don’t have any additional logs besides the ones I’ve already shared from Firebase. Based on the events we’ve sent, I can infer that users are encountering this crash randomly while navigating through the app. There doesn’t seem to be any specific pattern to it. Could it be related to the version? As I mentioned, we didn’t encounter this issue before. |
👍 Always weird to see other unrelated code in the stack trace but its totally possible that its benign.
Are you sure the app is crashing? Here's what I see in the stack trace:
This is why I asked about any additional logs before or after the stacktrace. Based on what I see, it just looks like a typical export request which failed after retry, with the stacktrace logged to show exactly what happened. Failed export attempts are common in unreliable networks like the internet. We retry to reduce their impact, but it doesn't always result in success. I expect the reliability of networks on android mobile devices is especially problematic. Side note, there's a contrib component called disk-buffering that aims to improve reliable transmission in mobile environments by buffering data to disk. |
@jack-berg Yes, since it’s a fatal exception, I’m sure it’s causing the crash. The error is also listed under the crash section in Firebase. I suspect the issue is due to throwing an IllegalStateException, because the accept method in the Serializer. converts an IOException into an IllegalStateException. This method is called from the serializeRepeatedMessageWithContext via In the code here, This method expects an IOException, but it throws an IllegalStateException. Because of this, the places where this method is used might be performing incorrect checks. When debugging, I noticed that when a StreamResetException is thrown at this point, it’s converted into an IllegalStateException, which leads to the app crash. However, when I forced it to throw the StreamResetException again at the same location, and ensured that the IllegalStateException was converted back to StreamResetException here, everything worked as expected. |
Great find! That's it. And all the calling code expects IOException so IllegalStateException goes uncaught. |
This part is within OpenTelemetry. What steps should I take to prevent crashes? Should I wait for a fix to be released, or do you have any other recommendations? |
I suspect the problem started impacting you in 1.44.0 because we switched to enabling resuable memory mode by default, which switches the serialization code path to the one that rethrows IOException as IllegalStateException. To get around this in the short terms, you can revert to the previous behavior by toggling We will definitely get this fixed for the next release (January 10th), and maybe a patch release before then. |
@celikrecep how urgent is it that we release a patch for this? Would it be ok to wait for the next release in early January? |
@jkwatson When i tried the method @jack-berg suggested, it seems like it will resolve the issue as it doesn’t hit the relevant line. We’ll send the package today or tomorrow. It’s probably not going to be an issue, but can i reach out depending on the situation? |
@celikrecep great, thanks. Since we're at the end of the year, and many are on holiday/vacation, we'd prefer to just wait for the next release cycle, if we can. Please let us know if it becomes urgent. |
@jkwatson sorry for the delay; the package had to be postponed. It seems we will have to wait for the January release. Happy holidays in advance! |
Hello, I am using the OpenTelemetry-Java SDK in an Android application. I am encountering a StreamResetException error. Normally, when an exception is thrown from requests made within the app, we catch these exceptions, but these network errors do not seem to fall into the same handling mechanism. I did not encounter this issue while using version 1.40.0, but I started experiencing it after upgrading to version 1.44.0. I found a similar issue for a different error, and I wanted to share it with you as I think it might be related. Since the stack trace did not point to any specific part of the project, I felt it necessary to open an issue. Could you please assist me with this? I am open to any suggestions.
The text was updated successfully, but these errors were encountered: