Skip to content

EnableWebSocket registers a non functional task scheduler to the context [SPR-16705] #21246

Closed

Description

@spring-projects-issues

Stéphane Nicoll opened SPR-16705 and commented

@EnableWebSocket may register a defaultSockJsTaskScheduler bean that could fallback to NoOpScheduler is no task scheduling is required (sic).

This conflicts with the default behaviour of @EnableScheduling. By default, it will look up for the unique presence of a TaskScheduler and, if one is found, it will use it.

Unfortunately, as soon as those two are in combinations (and @EnableWebSocket runs before @EnableScheduling), it breaks any app as a scheduling task is attempting to register itself to a no op scheduler.

The latter case is unfortunately quite common with Spring Boot as some auto-configurations (i.e. Spring Session Redis) rely on @EnableScheduling and users have @EnableWebSocket on their app to signal they want to use that feature.


Affects: 5.0.5

Issue Links:

Activity

  1. spring-projects-issues commented on Apr 10, 2018

    @spring-projects-issues
    CollaboratorAuthor
  2. spring-projects-issues commented on Apr 10, 2018

    @spring-projects-issues
    CollaboratorAuthor

    Stéphane Nicoll commented

    Good catch Artem!

  3. added
    type: bug
    status: duplicate
    in: web
    and removed
    type: bug
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webstatus: duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions