Skip to content

Deprecate AsyncTaskExecutor.execute(Runnable task, long startTimeout) #27959

Closed
@nytro77

Description

@nytro77

Affects: 5.3.15


The ThreadPoolTaskExecutor implements the AsyncTaskExecutor interface, so it has the method void execute(Runnable task, long startTimeout).

The implementation for that method silently ignores the timeout. It just calls the execute method without the timeout specified.

public void execute(Runnable task, long startTimeout) {
    execute(task);
}

The Javadoc for the method says that startTimeout is intended as a hint to the executor, but if the implementation does not support it at all I think it would be better to throw a org.springframework.core.task.TaskRejectedException instead.

To just silently ignore the startTimeout gives no clue to the caller that an unsupported method is called.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions