Skip to content

config: reload config by SIGUSR2#11589

Merged
Totktonada merged 1 commit intotarantool:masterfrom
Totktonada:gh-11585-config-reload-by-a-signal
Jun 26, 2025
Merged

config: reload config by SIGUSR2#11589
Totktonada merged 1 commit intotarantool:masterfrom
Totktonada:gh-11585-config-reload-by-a-signal

Conversation

@Totktonada
Copy link
Contributor

The idea is quite straightforward: once tarantool receives SIGUSR2, it reloads the YAML configuration. If the YAML configuration is not provided (the instance is started using the 2.x Lua script flow), it is no-op.

Consequent signals may be coalesced by the OS if they're sent fast enough. However, if tarantool is in processing of one reload triggered by a signal, the next signal is queued and a second reload happens after the first one.

The current implementation has a nuance: config:reload() called from Lua is not queued. If SIGUSR2 arrives during config:reload(), a log warning issued and the second reload doesn't happen. Similarly, automatic reload from a remote configuration source (etcd/config storage) is not queued.

These nuances are not an API guarantee and I hope that we'll process various kinds of reload requests in some uniform way in a future.

Fixes #11585

@Totktonada Totktonada requested a review from a team as a code owner June 18, 2025 17:24
@Totktonada Totktonada force-pushed the gh-11585-config-reload-by-a-signal branch 2 times, most recently from 49f62d8 to 7c8ae8c Compare June 19, 2025 09:08
@coveralls
Copy link

coveralls commented Jun 19, 2025

Coverage Status

coverage: 87.546%. remained the same
when pulling 879e33f on Totktonada:gh-11585-config-reload-by-a-signal
into 0b458f6
on tarantool:master
.

@locker locker removed their assignment Jun 19, 2025
@georgiy-belyanin georgiy-belyanin removed their assignment Jun 19, 2025
Copy link
Member

@grafin grafin left a comment

Choose a reason for hiding this comment

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

Thanks for the patch!

@grafin grafin assigned Totktonada and unassigned grafin Jun 26, 2025
The idea is quite straightforward: once tarantool receives `SIGUSR2`, it
reloads the YAML configuration. If the YAML configuration is not
provided (the instance is started using the 2.x Lua script flow), it is
no-op.

Consequent signals may be coalesced by the OS if they're sent fast
enough. However, if tarantool is in processing of one reload triggered
by a signal, the next signal is queued and a second reload happens after
the first one.

The current implementation has a nuance: `config:reload()` called from
Lua is not queued. If `SIGUSR2` arrives during `config:reload()`, a log
warning issued and the second reload doesn't happen. Similarly,
automatic reload from a remote configuration source (etcd/config
storage) is not queued.

These nuances are *not* an API guarantee and I hope that we'll process
various kinds of reload requests in some uniform way in a future.

Fixes tarantool#11585

@TarantoolBot document
Title: config: reload configuration by SIGUSR2

Now, tarantool reloads the YAML configuration if the `SIGUSR2` signal
arrives.
@Totktonada Totktonada force-pushed the gh-11585-config-reload-by-a-signal branch from 7c8ae8c to 879e33f Compare June 26, 2025 11:44
@Totktonada
Copy link
Contributor Author

Rebased on top of a fresh master.

@Totktonada Totktonada added the full-ci Enables all tests for a pull request label Jun 26, 2025
@Totktonada Totktonada merged commit 863dc7c into tarantool:master Jun 26, 2025
58 of 59 checks passed
@Totktonada Totktonada deleted the gh-11585-config-reload-by-a-signal branch June 26, 2025 18:29
@Totktonada Totktonada removed their assignment Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config: reload YAML configuration by a signal

6 participants