Skip to content

Application does not terminate upon completion of CommandLineRunner anymore #25885

Closed
@eduardobarrena-tc

Description

@eduardobarrena-tc

I run some java batch processes using this code structure:

@SpringBootApplication
public class Application {
    
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public CommandLineRunner commandLineRunner(MyServiceInstance service) {
        return args -> {
            service.doJob();
        };
    }

}

Prior spring 2.4.2 my service/process terminates after doing it's Job, so the code was convenient to run batch jobs. Starting from spring 2.4.2 the service instances do not terminate. So image the result all my instances are running in my AWS Batch account causing cost increases and blocking other jobs.

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions