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

storage-users: Add config option for graceful shutdown timeout #6840

Merged
merged 7 commits into from
Jul 19, 2023

Conversation

rhafer
Copy link
Contributor

@rhafer rhafer commented Jul 18, 2023

Add STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT setting to allow an graceful shutdown of the storage-users service. This currently only applicable when running storage-user as a sepearate service.

Setting STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT to a non-zero value gives the storage-users service a chance to cleanly shutdown and finish any in progess tasks (e.g. metadata propagation) before exiting.

Partial-Fix: #6602

Keeping this in draft for now, until the relate reva part is merged (cs3org/reva#4072)

@rhafer rhafer requested review from aduffeck and micbar July 18, 2023 10:40
@update-docs
Copy link

update-docs bot commented Jul 18, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@rhafer rhafer mentioned this pull request Jul 18, 2023
@rhafer rhafer marked this pull request as ready for review July 18, 2023 14:10
@mmattel
Copy link
Contributor

mmattel commented Jul 18, 2023

As just discussed with @rhafer, I am working on a commit to update the envvar text and a readme addon with an explanation. commit will come latest tomorrow morning.

Add STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT setting to allow a graceful
shutdown of the storage-users service. This currently only applicable
when running storage-user as a sepearate service.

Setting STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT to a non-zero value
gives the storage-users service a chance to cleanly shutdown and finish
any in progess tasks (e.g. metadata propagation) before exiting.

Partial-Fix: #6602
@mmattel
Copy link
Contributor

mmattel commented Jul 19, 2023

@saw-jan did some tests to proof my writing:

This is how I run:
start default services expect storage-users
OCIS_EXCLUDE_RUN_SERVICES=storage-users \  
./bin/ocis server

start storage-users in another terminal
STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT=5 \
STORAGE_USERS_LOG_LEVEL=debug \
./bin/ocis storage-users server

I just hit ctrl+c

...preparing for a graceful shutdown with deadline
...gracefully closed
...shutting down in 4 seconds

services/storage-users/README.md Outdated Show resolved Hide resolved
services/storage-users/README.md Outdated Show resolved Hide resolved
services/storage-users/README.md Outdated Show resolved Hide resolved
services/storage-users/README.md Outdated Show resolved Hide resolved
services/storage-users/README.md Outdated Show resolved Hide resolved
@saw-jan
Copy link
Member

saw-jan commented Jul 19, 2023

@saw-jan did some tests to proof my writing:

This is how I run:
start default services expect storage-users
OCIS_EXCLUDE_RUN_SERVICES=storage-users \  
./bin/ocis server

start storage-users in another terminal
STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT=5 \
STORAGE_USERS_LOG_LEVEL=debug \
./bin/ocis storage-users server

I just hit ctrl+c

...preparing for a graceful shutdown with deadline
...gracefully closed
...shutting down in 4 seconds

Command kill <pid> will terminated the service immediately

[1]    174239 terminated  STORAGE_USERS_GRACEFUL_SHUTDOWN_TIMEOUT=5 STORAGE_USERS_LOG_LEVEL=debug

mmattel and others added 2 commits July 19, 2023 13:02
Co-authored-by: Edith Parzefall <edith_parzefall@gmx.de>
Co-authored-by: Edith Parzefall <edith_parzefall@gmx.de>
@mmattel
Copy link
Contributor

mmattel commented Jul 19, 2023

Command kill will terminated the service immediately

good point, will add that.

Co-authored-by: Edith Parzefall <edith_parzefall@gmx.de>
@sonarcloud
Copy link

sonarcloud bot commented Jul 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@mmattel mmattel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a docs pov 👍

@mmattel mmattel merged commit 7a0bdce into master Jul 19, 2023
@delete-merged-branch delete-merged-branch bot deleted the graceful-timeout branch July 19, 2023 14:19
ownclouders pushed a commit that referenced this pull request Jul 19, 2023
storage-users: Add config option for graceful shutdown timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Graceful Shutdown
5 participants