-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Scatter Gather is getting hung when Nested Scatter Gathers are used #3152
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
Comments
Hi, On Further analysis of issue, in version 5.1.3, reply channels are handled in handleRequestMessage. Reply channels are directly taken from the request message headers. Also no additional headers are added to the request sent to the subflows.
In 5.2.4 version, ReplyChannel and ErrorChannel are copied to headers ORIGINAL_REPLY_CHANNEL, ORIGINAL_ERROR_CHANNEL. This process is not taking care of any ORIGINAL_REPLY_CHANNEL, ORIGINAL_ERROR_CHANNEL already available in request headers. if these headers are already present in the headers, they will be overridden without being preserved for the reply path. This is causing issue in the nested ScatterGather situations.
|
Hi, I have done fix for the issue. But I am not able to raise a pull request as i dont have access to raise pull request. Please find the attached code to fix the issue with Nested channels. There is further scope to refine the scatter gather. |
thank you very much for the report! I'll take a look into this today.
I wonder if you have forked the project, created a branch for the fix and then you can try to Pull Request it. See instructions here: https://github.com/spring-projects/spring-integration/blob/master/CONTRIBUTING.adoc |
I'm sorry, would you mind to be more specific. So, what we are looking for? Meanwhile I'll try to analyze your code... |
I have fixed your problem with this The real problem that you block the main thread waiting for gatherer reply with the I'm not sure yet that can do anything on the matter, more over we have documented such a situation to make you ready: https://docs.spring.io/spring-integration/docs/5.2.3.RELEASE/reference/html/message-routing.html#scatter-gather-error-handling
So, I'll wait for your feedback, but sounds like "Works as Designed" |
Hi Artem, it seems I didnt properly explain. Test case ScatterGatherTestSuccess always hangs. Not sure how that works for you. GatherTumeout is to handle timeout scenarios. |
Ok. Try to have only that one single test. Please, come back to me with a minimal reproducing sample and with consistent versions. In one comment you claimed one version, the you talk about different. And in your sample we have a third one. Thanks for understanding! |
Hi @artembilan, Good Morning. I have updated the test project to have only failing test case(hangs forever) with version 5.2.3. Same test case works perfectly fine with version 5.1.3 Thanks, |
Good. I’ll take a look in my morning in 12 hours 😀 |
You still are confusing me. Does it work with version |
It works with 5.1.4, 5.1.5, 5.1.6 as well |
OK. Thanks. BTW, you can override versions in your Spring Boot application using specific property. See more here: https://docs.spring.io/spring-boot/docs/2.2.4.RELEASE/reference/html/howto.html#howto-customize-dependency-versions I mean you have overidden the version for |
Please, give me a working sample. Give me, please, as simple code as possible and the single test-case which fails with the current version, but works with that latest |
Hi @artembilan I have tried with correcting the versions and tried all possible options before creating the issue. |
M-m-m. We are going to sit here forever... One more time: please, give me a simple project (only flow you worry about) with a single test-case which fails in version
Might be the case 😉 . That's why I'm asking about single tests and simple single flow (even if it is with a nested Thanks for understanding. |
HI @artembilan , I have updated the the project with single test case. Please test with versions 5.1.6 & 5.1.7 please. 5.1.6 test case is successful. But in 5.1.7 the same test case fails. https://github.com/sirimamilla/ScatterGatherTest |
So, confirmed the issue. Previously we had a Looking into provide PR for the possible fix. thank you for your report and the fix! |
…eaders. Added additional not to be executed line of code in test case. spring-projects#3152
Fixes #3152 The upstream `gatherResultChannel` header has been missed when we produced a reply from nested scatter-gather Added Test Case for Nested Scatter Gather test Simplified the the test cases and added author in changed cases Corrected codestyle issue in Travis CI Removed additional OriginalReplyChannel and originalErrorChannel in Headers. Added additional not to be executed line of code in test case. Restored OriginalErrorChannel Header and removed error handling related fixes * Clean up code style and improve readability **Cherry-pick to 5.1.x & master**
Fixes #3152 The upstream `gatherResultChannel` header has been missed when we produced a reply from nested scatter-gather Added Test Case for Nested Scatter Gather test Simplified the the test cases and added author in changed cases Corrected codestyle issue in Travis CI Removed additional OriginalReplyChannel and originalErrorChannel in Headers. Added additional not to be executed line of code in test case. Restored OriginalErrorChannel Header and removed error handling related fixes * Clean up code style and improve readability **Cherry-pick to 5.1.x & master** # Conflicts: # spring-integration-core/src/test/java/org/springframework/integration/dsl/routers/RouterTests.java
HI @artembilan, Thanks a ton for patiently working this fix. I have learnt a lot from you during the process of fix. When will 5.1.x or 5.2.x be released with this fix? |
Although we may consider to not release Let me think if we can come up with some workaround not to wait for upgrading version! |
Here is a workaround:
What is my point that I store a top-level |
5.2.3.log
5.1.3.log
Affects Version(s): <Spring Integration version>
5.1.7 and above
5.2.3
Hi,
Scatter Gather is failing when nested scatter Gathers are used with latest versions of Spring Integration. we tried with 5.1.7, 5.1.9 and 5.2.3. Same is working fine in 5.1.6 and below.
Here is the sample project
https://github.com/sirimamilla/ScatterGatherTest
Test case ScatterGatherTestSuccess runs indefinitely in this project.
when analyzed, scatter gather is using origialReplyChannel and originalErrorChannel Headers to preserve the previous original reply and error channels.
Inner scatterGather is responding correctly to the outer scatter gather. But outer scatter gather is failing to respond as it is finding its own gatherchannel in original replychannel header and sending response to gather channel and waiting indefinitely to continue.
This issue is blocking our version upgrade from spring boot 2.1.3 to 2.2.4. Please assist.
Regards,
Jayadev
The text was updated successfully, but these errors were encountered: