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

Ensure that runtime created API objects survive a restart #7150

Merged
merged 5 commits into from
Apr 30, 2019

Conversation

dnsmichi
Copy link
Contributor

@dnsmichi dnsmichi commented Apr 26, 2019

Story: #7119

  • Runtime created objects exist after restart (downtimes, comments, hosts, services, etc.)
  • Reduce file I/O with active-stage reads, cache the details in memory
  • Improve error handling, add exceptions and avoid wrong reads/writes
  • Log config package errors on startup
  • Repair missing active-stage files from a 5min timer, if they get deleted (brute force user action, the code uses lock guards now).

fixes #7119

Michael Friedrich added 4 commits April 26, 2019 13:40
This prevents reading the file everytime the stageName is required
for when creating a runtime object via REST API.
This means a new timer which checks every 5m whether the
active-stage can be read, and if not, it overwrites the
file on disk with the details from memory.
@dnsmichi dnsmichi changed the title Ensure that runtime create API objects survive a restart Ensure that runtime created API objects survive a restart Apr 26, 2019
@dnsmichi dnsmichi added this to the 2.11.0 milestone Apr 26, 2019
@dnsmichi dnsmichi added area/api REST API bug Something isn't working labels Apr 26, 2019
@dnsmichi dnsmichi merged commit 759b090 into master Apr 30, 2019
@dnsmichi dnsmichi deleted the bugfix/api-config-package-active-stage-name branch April 30, 2019 12:22
dnsmichi pushed a commit that referenced this pull request May 9, 2019
This partially reverts #7150 and adds new creation/repair methods.
dnsmichi pushed a commit that referenced this pull request May 10, 2019
This partially reverts #7150 and avoids exceptions
inside the flow. Each time an empty active stage
is detected, Icinga tries to repair it from the
the given directory tree.

Also, the code now takes into account that it should
create the package storage on startup, whether within
the API object, or if disabled, inside the application.

Caching the active stages for packages in memory
only is in effect with the API feature being enabled.
This is useful for other deployed config packages,
not only the internal one.

fixes #7173
refs #7150
refs #7119
fixes #6959
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runtime created objects via API stored in wrong path outside of config package (broken stage name)
1 participant