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

Problem using ably-java with newrelic #258

Closed
SimonWoolf opened this issue Dec 23, 2016 · 9 comments
Closed

Problem using ably-java with newrelic #258

SimonWoolf opened this issue Dec 23, 2016 · 9 comments
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@SimonWoolf
Copy link
Member

Customer reported a io.ably.lib.types.AblyException: java.io.IOException: readBufferBytes failed exception calling ably.channels.get(channelId).history(null).items(); (with ably-java 0.8.8). Stacktrace:

W/System.err: io.ably.lib.types.AblyException: java.io.IOException: readBufferBytes failed
W/System.err: at io.ably.lib.http.Http.httpExecute(Http.java:439)
W/System.err: at io.ably.lib.http.Http.httpExecute(Http.java:380)
W/System.err: at io.ably.lib.http.Http.httpExecuteWithRetry(Http.java:460)
W/System.err: at io.ably.lib.http.Http.ablyHttpExecute(Http.java:335)
W/System.err: at io.ably.lib.http.Http.get(Http.java:243)
W/System.err: at io.ably.lib.http.PaginatedQuery.get(PaginatedQuery.java:49)
W/System.err: at io.ably.lib.realtime.Channel.history(Channel.java:625)
<frames from customer app redacted>
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:485)
W/System.err: at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:479)
W/System.err: at org.greenrobot.eventbus.AsyncPoster.run(AsyncPoster.java:46)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
W/System.err: at java.lang.Thread.run(Thread.java:818)
W/System.err: Caused by: java.io.IOException: readBufferBytes failed
W/System.err: at com.newrelic.agent.android.instrumentation.io.CountingInputStream.read(CountingInputStream.java:160)
W/System.err: at io.ably.lib.http.Http.readInputStream(Http.java:657)
W/System.err: at io.ably.lib.http.Http.readResponse(Http.java:623)
W/System.err: at io.ably.lib.http.Http.httpExecute(Http.java:437)

They report that on disabling newrelic, the problem disappears. They're using a newrelic version of "5.+" (?).

We should try and reproduce this, and figure out what's causing the bad interaction between ably-java and newrelic.

@mattheworiordan mattheworiordan added the bug Something isn't working. It's clear that this does need to be fixed. label Mar 9, 2017
@thoersch
Copy link

What's the status of this?

@SimonWoolf
Copy link
Member Author

At the time we investigated this, the only known workaround was to disable newrelic; see
https://support.ably.io/support/solutions/articles/3000061212-ably-java-java-io-ioexception-readbufferbytes-failed-exception-when-making-rest-requests . I don't believe we have tested this recently, so it's possible that more recent versions of the newrelic library have fixed the issue.

@mattheworiordan
Copy link
Member

@thoersch what version of NewRelic are you using when you see this issue?

@thoersch
Copy link

We're not -- we're a prospect client only at this point and wanted to ensure this was not an issue anymore before proceeding further. We do use NR so it's important that it's not an issue anymore. We're also not the reporter of the issue so unsure what version they had.

We're using 3.44.1 though, if that helps.

@mattheworiordan
Copy link
Member

We do use NR so it's important that it's not an issue anymore

@thoersch given this has not been reported since Dec 2016, I very much doubt this is still an issue with NewRelic. However, if you do encounter this issue, we will have to dive deeper and resolve the issue. I am very confident that if the issue still exists, a workaround could be found, even if that requires us discussing the issue with NewRelic and/or forking their library and seeing if we can get a fix merged in upstream.

@mattheworiordan
Copy link
Member

I would recommend testing it in your environment either way to see if the issue is present or not. Given this was reported and not reproduced at the time, we have no way of knowing if this issue was necessarily caused solely by NewRelic.

@paddybyers
Copy link
Member

paddybyers commented Nov 1, 2018

I've tested against a recent version of NewRelic on Android, and both websocket connections and HTTP requests seem to work without any issues.

I set up the NewRelic integration with:

classpath 'com.newrelic.agent.android:agent-gradle-plugin:5.+'

in buildscript.dependencies and

    implementation 'com.newrelic.agent.android:android-agent:5.+'

in the app dependencies.

In my code I was setting up NewRelic with every option that could give rise to interference with the Ably library:

        NewRelic.withApplicationToken("xxxxxxxxxx").start(this.getApplication());
        NewRelic.enableFeature(FeatureFlag.NetworkRequests);
        NewRelic.enableFeature(FeatureFlag.NetworkErrorRequests);
        NewRelic.enableFeature(FeatureFlag.HttpResponseBodyCapture);

This was with ably-java for Android v 1.0.7.

@paddybyers
Copy link
Member

We're using 3.44.1 though, if that helps.

@thoersch I'm not seeing that version in https://docs.newrelic.com/docs/release-notes/mobile-release-notes/android-release-notes

@paddybyers
Copy link
Member

I'm closing this - as far as we know, there aren't any issues now with new relic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

No branches or pull requests

4 participants