-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
IllegalArgumentException when trying to zip an iterable of several FluxJust-s #338
Comments
Here's stacktrace
|
… FluxJust-s Make Tuples create Tuple8 from array of length 8
there's a couple of issues there, that render that signature effectively unusable :( The shortest fix is to indeed cover the but keep in mind that Even if we fix the root cause in As that signature was never actually usable, that makes us wonder if that signature should be removed altogether, actually |
@simonbasle, |
actually, even if you don't know the number of flux, that signature isn't even that useful. It returns a |
@simonbasle , you're right off-topic: is it possible that FluxPublishOnTest::normalFilteredBackpressured test is unstable? |
@kirmerzlikin: yeah, not very useful. we are considering 2 options at this point:
That alternative solution still is impacted by the current issue though: on your side note, yes some tests are unfortunately still a bit unstable :( |
The CI sometimes runs on timeout in Travis (unlike our bamboo builds) but we have an ongoing story to separate consistency jobs that send millions of events like this one from operator testing. |
@simonbasle, Also, considering mentioned options, existing test unstability and this comment, I think that I should close my PR and just wait for 3.0.5.RELEASE (-_-) zzz |
I concur @kirmerzlikin , we just want to keep it simple and symmetric and consistent, other indeterministic zip operate with a combinator because beyond 6 you just want to quickly materialize the result in your own POJO or risk weak semantic on the passed signal (e.g. finding out what's getT1/getT2.../getT8 when you are downstream). We might want to deprecate it and Tuple8 but not remove them all together just now before 3.1 to avoid any binary compatibility issue. |
Separately I'd like to propose a Tuple2#flatten method that would recursively flatten tuple inside tuple in a final Object[]. This might be useful to the user doing: |
Size 8 to Tuple8 should have been acceptable but wasn't covered. Size 0 was rejected but with misleading message. Added special message and shortcircuit for null or empty arrays. Made oversize error message more explicit. Added tests to TupleTests for these different cases.
Flux.zip(Iterable) is a clunky API: as it combines to Tuples, it limits the number of acceptable sources to 1-8. Furthermore, the Tuple2 return type means that you either need to know the number of sources in order to cast to the relevant TupleN (in which case you should instead use zip(source1, source2, ...)) OR you can only use the tuple as Iterable. In all cases, combining to a List would be more relevant, and usage of a custom combinator or of the fixed sources alternatives is to be preferred from now on. Using a custom combinator like Arrays::asList is susceptible to a bug if the number of sources is below 8 though: the scalars Object array is initialized to a length of 8 in any case, and grows beyond if needed, but it is not trimmed in FluxZip#handleIterableMode if we have less than 8 sources. This is now fixed and tested.
Size 8 to Tuple8 should have been acceptable but wasn't covered. Size 0 was rejected but with misleading message. Added special message and shortcircuit for null or empty arrays. Made oversize error message more explicit. Added tests to TupleTests for these different cases.
This test fails due to the IllegalArgumentException, thrown by a FluxZip::handleBoth.
Exception is caused by two factors:
The text was updated successfully, but these errors were encountered: