Skip to content

@Scheduled task runs twice on bean with target-class scoped proxy (when injected) [SPR-17166] #21702

Closed
@spring-projects-issues

Description

@spring-projects-issues

Markus Malkusch opened SPR-17166 and commented

When a proxied bean has a @Scheduled annotation, that task is executed twice as if there would be two beans. As a user I would expect that a proxied bean still behaves and acts as there would be only one bean. I would expect the task to be executed only once.

If you run the example, you notice two outputs every second, while I would expect only one output per second.


Affects: 4.3.18, 5.0.8

Reference URL: spring-attic/spring-framework-issues#182

Issue Links:

Backported to: 4.3.19

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)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