Commit 3b5bb2e
committed
Remove redundant
Related to: spring-projects/spring-integration#9362
After the fix in Spring Integration: spring-projects/spring-integration@bdcb856
we ended up in a deadlock situation with a `beginPublishingTrigger` in the `FunctionConfiguration`
used for the `delaySubscription()` on an original `Publisher`.
The `FluxMessageChannel` uses its own `delaySubscription()` until the channel has its subscribers.
Apparently the logic before was with errors, so the `FluxMessageChannel` was marked as active
even if its subscriber is not ready yet, leading to famous `Dispatcher does not have subscribers` error.
So, looks like this `beginPublishingTrigger` was introduced back in days in Spring Cloud Stream
to mitigate that situation until we really emit a `BindingCreatedEvent`.
The deadlock (and the flaw, respectively) is with the `setupBindingTrigger()` method implementation
where `FluxMessageChannel` now "really" delays a subscription to the provided `Publisher`,
therefore not triggering that `Mono.create()` fulfilment immediately.
The `BindingCreatedEvent` arrives earlier, than we have a subscriber on the channel,
but `triggerRef.get()` is `null`, so we don't `success()` it and in the end don't subscribe
to an original `Publisher` since `delaySubscription()` on it is never completed.
Since `FunctionConfiguration` fully relies on `IntegrationFlow.from(Publisher)`,
which ends up with the mentioned `FluxMessageChannel.subscribeTo()` and its own `delaySubscription()`
(which, in turn, apparently fixed now), we don't need our own `delaySubscription()` any more.
Therefore the fix in this PR is to propose to remove `beginPublishingTrigger` logic altogether.delaySubscription from FunctionConfiguration
1 parent f356599 commit 3b5bb2e
1 file changed
Lines changed: 6 additions & 26 deletions
File tree
- core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/function
Lines changed: 6 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| |||
129 | 127 | | |
130 | 128 | | |
131 | 129 | | |
| 130 | + | |
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
| |||
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
227 | | - | |
228 | | - | |
229 | 226 | | |
230 | 227 | | |
231 | 228 | | |
| |||
239 | 236 | | |
240 | 237 | | |
241 | 238 | | |
242 | | - | |
| 239 | + | |
243 | 240 | | |
244 | 241 | | |
245 | 242 | | |
| |||
253 | 250 | | |
254 | 251 | | |
255 | 252 | | |
256 | | - | |
| 253 | + | |
257 | 254 | | |
258 | 255 | | |
259 | 256 | | |
| |||
274 | 271 | | |
275 | 272 | | |
276 | 273 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | 274 | | |
295 | 275 | | |
296 | | - | |
| 276 | + | |
297 | 277 | | |
298 | 278 | | |
299 | 279 | | |
| |||
309 | 289 | | |
310 | 290 | | |
311 | 291 | | |
312 | | - | |
313 | | - | |
| 292 | + | |
| 293 | + | |
314 | 294 | | |
315 | 295 | | |
316 | 296 | | |
| |||
0 commit comments