Skip to content

Low polling frequency with a task executor may lead to Rejected tasks building up in the error channel [INT-2988] #6965

@spring-operator

Description

@spring-operator

Biju Kunjummen opened INT-2988 and commented

This may not be an issue at all:

The issue that I am seeing is, if the poller attached to an endpoint is configured with a very low polling frequency (say 10 milliseconds) and dispatches the message handling to a task executor and if the endpoint is slow to process, since the polling task is added to the task executor once the task executor reaches the capacity it starts rejecting tasks(default behavior) and these rejection messages now end up with the errorHandler channel. If by any chance the errorHandler is configured as a queue channel the messages keep building up and can be considered a memory leak.

Here is a dummy configuration with which this scenario can be easily replicated:

	<channel id="input">
		<queue capacity="5"/>
	</channel>
	
	<channel id="output">
		<queue capacity="5"/>
	</channel>
	
	<channel id="errorChannel">
		<queue/>
	</channel>
	
	<service-activator expression="@slowService.slowActivity(payload)" input-channel="input" output-channel="output">
		<poller fixed-delay="20"  max-messages-per-poll="10" task-executor="taskExecutor"></poller>
	</service-activator>

	<beans:bean name="slowService" class="taskexec.SlowService" />
	
	<task:executor id="taskExecutor" pool-size="10" queue-capacity="10"/>

Again, not sure if this is really a bug, but I think a better message will be helpful, since the polling task is being rejected not the real message.


Affects: 2.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedThere won't be a fix for some reason

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions