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.

Comment From: sbrannen

At the very least, I think we should introduce custom Javadoc for that method to point out that the startTimeout argument is ignored, and we could also log a warning/info/debug message.

Comment From: jhoeller

Start timeouts were technically meant as a hint in the sense of "to be ignored if it cannot be respected", just like transaction timeouts or statement timeouts with JDBC which are often effectively ignored by the driver implementation as well.

That said, since the only implementation which actually supported start timeouts (WorkManagerTaskExecutor) went away in 6.0, I'd rather deprecate the method in 5.3.x and possibly remove it in 6.0 completely. I'll repurpose this issue accordingly.