Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Being able to provide extended timeouts for specific phases in the DefaultLifecycleProcessor #32985

Closed
ansgarschulte opened this issue Jun 7, 2024 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@ansgarschulte
Copy link

Affects: 6.1.6

Context: LifecycleProcessor / DefaultLifecycleProcessor

We would like to have the possibility to change the timeoutPerShutdownPhase for specific phases.
During the graceful shutdown, we have processes where we have to wait longer than the default timeout.
But we cannot just change the default timeoutPerShutdownPhase, because of long-running http requests running, which should be cancled in default time.

I would be happy to provide a pull request if you'd like.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 7, 2024
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 7, 2024
@jhoeller jhoeller added this to the 6.2.x milestone Jun 7, 2024
@jhoeller jhoeller self-assigned this Jun 7, 2024
@jhoeller
Copy link
Contributor

jhoeller commented Jun 7, 2024

Making individual timeouts configurable per specific phase sounds good to me. We need to make up our mind on how to design the methods for configuring these, e.g. a setTimeoutsForShutdownPhases(Map<Integer, Long> (which we would traditionally do for an XML setup style) or something nicer for programmatic use in an @Bean method.

In any case, this fits nicely into 6.2 where we refine some lifecycle defaults already: #32152

@ansgarschulte
Copy link
Author

I build a custom LifecycleProcessor for this use case by providing setTimeoutsForShutdownPhases.
That works pretty well

@jhoeller jhoeller modified the milestones: 6.2.x, 6.2.0-M4 Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants