You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproducer: org.asynchttpclient.reactivestreams.ReactiveStreamsTest#main (might have to run several times):
testConnectionDoesNotGetClosed(org.asynchttpclient.reactivestreams.ReactiveStreamsTest) Time elapsed: 0.342 sec <<< FAILURE!
java.lang.AssertionError: expected [[B@95f1422] but found [[B@31b7112d]
at org.asynchttpclient.reactivestreams.ReactiveStreamsTest.testConnectionDoesNotGetClosed(ReactiveStreamsTest.java:66)
I've been thinking about this failure for a few days now and still can't figure out what would be causing this. What's the exact command you're running?
I'm inclined to say the same. The fact that it's the same failure every time on my machine is just weird though.
In any event I'm skeptical that the bug is in AHC. Might be worthwhile to try playing with the underlying Netty version to see if the problem disappears. Have you done that yet?
Can we backport this test to an earlier version of AHC?
It fails too on AHC 2.0
My thought on this is that if AHC 2.0 exhibits the same bug then this isn't a regression and we should feel free to move forward releasing AHC 2.1.
I currently have no idea if this bug is only limited to reactivestreams based features or if it's a critical issue that just happened to be spotted here. I don't feel comfortable releasing the next stable version with such doubt lurking around.
I currently have no idea if this bug is only limited to reactivestreams based features or if it's a critical issue that just happened to be spotted here.
I don't know the codebase well enough to answer this question for sure, but the surface area of AHC itself on the critical path for this feature seems relatively small to me. The fact that it fails, too, on AHC 2.0 means that in your shoes I'd probably release the code with a Known Bug caveat in the release notes. That is just me, however.
I don't have time this weekend, but perhaps next weekend I'll have time to dig in and see if I can play with dependencies and determine whether or not changing netty versions and such causes the problem to disappear.
@farmdawgnation Please give it a try. I'm pretty sure it was a RxJava 1 bug that was fixed in RxJava 2. There are other foobar stuffs related to reactive streams that I want to clean up before releasing 2.1. I'll work on this when I'll be back from vacation.
I think Subscription is being sometimes requested from 2 different threads: from the calling thread and from the channel's event loop. When such switch happen, I think chunks can be written out of order as the ones read from the calling thread have to jump into the event loop.
Activity
Try to get more information, see #1380
farmdawgnation commentedon Jul 3, 2017
I checked the most recent build from Travis.
I found this buried in the logs.
I'm not sure, but it looks like there's more than one issue going on here...
slandelle commentedon Jul 5, 2017
I'm pretty sure I got the
BasicHttpsTest.multipleSequentialPostRequestsOverHttpsfailure pinned, see #1434But sadly, it's completely unrelated to the
ReactiveStreamsTest.testConnectionDoesNotGetClosedone :(Adding some more detail to the ReactiveStreamsTest, see #1380
slandelle commentedon Jul 5, 2017
I can get
ReactiveStreamsTest#mainto fail almost every time on my machine:farmdawgnation commentedon Jul 18, 2017
I've been thinking about this failure for a few days now and still can't figure out what would be causing this. What's the exact command you're running?
slandelle commentedon Jul 18, 2017
I just run main method from IntelliJ.
farmdawgnation commentedon Jul 19, 2017
Ah, there's a main method in the unit test. I was just running the test from
mvnon the command line. Let me try that.farmdawgnation commentedon Jul 19, 2017
Okay, I was able to reproduce the failure. I don't have a solution here yet but I think I've learned some interesting things:
Thread.sleeps in the test or in the test server.Position 12000 is exactly at 12 kilobytes. Is that a magic number of a buffer somewhere important?
farmdawgnation commentedon Jul 19, 2017
Oh. Also. When the entire content fails it fails the same way. The MD5 of the bad response is the same each time.
slandelle commentedon Jul 19, 2017
I've seen it happen at offset 24,000 too
12000 bytes is not 12kb :)
The problem is not server side as I was able to reproduce with Jetty, Netty and Tomcat.
12000 has not be some buffer size, either in Netty or kernel but I wasn't able to spot it. It happens on OSX (my machine) and Linux (Travis).
No idea what happens. Looks like buffer corruption.
farmdawgnation commentedon Jul 19, 2017
I'm inclined to say the same. The fact that it's the same failure every time on my machine is just weird though.
In any event I'm skeptical that the bug is in AHC. Might be worthwhile to try playing with the underlying Netty version to see if the problem disappears. Have you done that yet?
slandelle commentedon Jul 20, 2017
I can reproduce with Netty 4.1.0.Final. I didn't bother digging further.
This feature involves many libs:
Hard to figure out where issue might happen.
I've checked netty-reactive-streams sources and couldn't spot an issue.
farmdawgnation commentedon Jul 21, 2017
Can we backport this test to an earlier version of AHC?
My thought on this is that if AHC 2.0 exhibits the same bug then this isn't a regression and we should feel free to move forward releasing AHC 2.1.
slandelle commentedon Jul 22, 2017
It fails too on AHC 2.0
I currently have no idea if this bug is only limited to reactivestreams based features or if it's a critical issue that just happened to be spotted here. I don't feel comfortable releasing the next stable version with such doubt lurking around.
farmdawgnation commentedon Jul 22, 2017
I don't know the codebase well enough to answer this question for sure, but the surface area of AHC itself on the critical path for this feature seems relatively small to me. The fact that it fails, too, on AHC 2.0 means that in your shoes I'd probably release the code with a Known Bug caveat in the release notes. That is just me, however.
I don't have time this weekend, but perhaps next weekend I'll have time to dig in and see if I can play with dependencies and determine whether or not changing netty versions and such causes the problem to disappear.
slandelle commentedon Jul 24, 2017
@farmdawgnation Please give it a try. I'm pretty sure it was a RxJava 1 bug that was fixed in RxJava 2. There are other foobar stuffs related to reactive streams that I want to clean up before releasing 2.1. I'll work on this when I'll be back from vacation.
farmdawgnation commentedon Jul 25, 2017
Huzzah! It seems to resolved the issue on my end, too!
slandelle commentedon Jul 27, 2017
Great, thanks for the feedback!
slandelle commentedon Nov 28, 2017
Issue still happens almost every time on Travis.
I think I have a clue: playframework/netty-reactive-streams#37
I think Subscription is being sometimes requested from 2 different threads: from the calling thread and from the channel's event loop. When such switch happen, I think chunks can be written out of order as the ones read from the calling thread have to jump into the event loop.
Upgrade to RfJava2 for testing reactive streams, close AsyncHttpClien…
Don't automatically start requesting on subscribe, close AsyncHttpCli…