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

Avoid unneeded runner restarts when using config reloading #7232

Merged
merged 1 commit into from
Jun 1, 2018

Conversation

exekias
Copy link
Contributor

@exekias exekias commented Jun 1, 2018

Introduced by #7172, some inputs/modules may modify the passed
configuration, this results on a effective change on the hash of
the config. Before this change, the reload process was taking a running
config as a not running config. Resulting on a stop/start after the
first run.

Failing example, before this change:

First run (add 1 config):

2018-06-01T02:08:20.184+0200    DEBUG   [autodiscover] cfgfile/list.go:53      Starting reload procedure, current runners: 0
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:143 map[type:docker containers:map[ids:[56322b70c8a3712494e559381c7b8a6ce62a6495e33630628e6624b75b5a7505]]]
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:144     Hash: %!s(uint64=12172188027786936243)
2018-06-01T02:08:20.185+0200    DEBUG   [autodiscover] cfgfile/list.go:71      Start list: 1, Stop list: 0

Second run (add another config, the first one gets restarted):

2018-06-01T02:08:20.185+0200    DEBUG   [autodiscover] cfgfile/list.go:53      Starting reload procedure, current runners: 1
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:143 map[paths:[/var/lib/docker/containers/56322b70c8a3712494e559381c7b8a6ce62a6495e33630628e6624b75b5a7505/*.log] docker-json:map[stream:all partial:true] type:docker containers:map[ids:[56322b70c8a3712494e559381c7b8a6ce62a6495e33630628e6624b75b5a7505]]]
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:144     Hash: %!s(uint64=12741034856879725532)
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:143 map[type:docker containers:map[ids:[a626e25679abd2b9af161277f1beee96c1bba6b9412771d17da7ebfacca640a7]]]
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:144     Hash: %!s(uint64=7080456881540055745)
2018-06-01T02:08:20.185+0200    DEBUG   [autodiscover] cfgfile/list.go:71      Start list: 2, Stop list: 1

Introduced by elastic#7172, some inputs/modules may modify the passed
configuration, this results on a effective change on the hash of
the config. Before this change, the reload process was taking a running
config as a not running config. Resulting on a stop/start after the
first run.

Example (with some added debugging):

First run (add 1 config):
```
2018-06-01T02:08:20.184+0200    DEBUG   [autodiscover] cfgfile/list.go:53      Starting reload procedure, current runners: 0
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:143 map[type:docker containers:map[ids:[56322b70c8a3712494e559381c7b8a6ce62a6495e33630628e6624b75b5a7505]]]
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:144     Hash: %!s(uint64=12172188027786936243)
2018-06-01T02:08:20.185+0200    DEBUG   [autodiscover] cfgfile/list.go:71      Start list: 1, Stop list: 0
```

Second run (add another config, the first one gets restarted):
```
2018-06-01T02:08:20.185+0200    DEBUG   [autodiscover] cfgfile/list.go:53      Starting reload procedure, current runners: 1
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:143 map[paths:[/var/lib/docker/containers/56322b70c8a3712494e559381c7b8a6ce62a6495e33630628e6624b75b5a7505/*.log] docker-json:map[stream:all partial:true] type:docker containers:map[ids:[56322b70c8a3712494e559381c7b8a6ce62a6495e33630628e6624b75b5a7505]]]
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:144     Hash: %!s(uint64=12741034856879725532)
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:143 map[type:docker containers:map[ids:[a626e25679abd2b9af161277f1beee96c1bba6b9412771d17da7ebfacca640a7]]]
2018-06-01T02:08:20.185+0200    INFO    cfgfile/list.go:144     Hash: %!s(uint64=7080456881540055745)
2018-06-01T02:08:20.185+0200    DEBUG   [autodiscover] cfgfile/list.go:71      Start list: 2, Stop list: 1
```
@exekias exekias requested a review from ruflin June 1, 2018 00:19
@ruflin ruflin merged commit 281304f into elastic:master Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants