Skip to content

TaskExecutorRegistration.getTaskExecutor() overrides executor properties of a provided ThreadPoolTaskExecutor [SPR-15962] #20514

@spring-projects-issues

Description

@spring-projects-issues

Brian Stocco opened SPR-15962 and commented

When configuring the threadpool for the websocket clientOutboundChannel for example I will override public void configureClientOutboundChannel(ChannelRegistration registration). On the ChannelRegistration I can call taskExecutor(taskExecutor) and provide a ThreadPoolTaskExecutor which is set in the the ChannelRegistration's TaskExecutorRegistration.

However, when the getTaskExecutor() method is called on the TaskExecutorRegistration my ThreadPoolTaskExecutor is used, but the default settings for the TaskExecutorRegistration then immediately override whatever was set on the ThreadPoolTaskExecutor I provided.

This doesn't seem like the intended logic. I would expect to either provide the settings to the TaskExecutorRegistration and have it create a ThreadPoolTaskExecutor with those settings for me, or provide my own ThreadPoolTaskExecutor object, but I would not expect to have some settings overridden on the provided ThreadPoolTaskExecutor.

I encountered this in 4.2.9, but the latest source code in Github still seems to have this issue.


Affects: 4.2.9

Issue Links:

Referenced from: commits d11bd64, ac9cfef

Backported to: 4.3.12

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions