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

Add Zabbix API timeout #69

Merged
merged 3 commits into from
Nov 14, 2023
Merged

Add Zabbix API timeout #69

merged 3 commits into from
Nov 14, 2023

Conversation

pederhan
Copy link
Member

@pederhan pederhan commented Nov 14, 2023

This PR adds configurable timeouts for connecting and reading from the Zabbix API. This prevents the application from hanging from waiting indefinitely on HTTP requests that will never be answered by the API.

Config

A new config option has been added to the [zabbix] table:

[zabbix]
timeout = 60

By default, the timeout is set to 60 seconds, but can be disabled by setting it to 0:

[zabbix]
timeout = 0

Dependencies

A new dev dependency pytest-timeout has been added to facilitate testing of subprocesses. Its fixture pytest.mark.timeout simplifies termination of processes with no set end duration. It allows us to easily wait for certain conditions in the processes without fear of looping forever if the condition is not hit.

@pederhan pederhan merged commit b3c71c1 into unioslo:master Nov 14, 2023
3 checks passed
@pederhan pederhan deleted the timeouts branch November 14, 2023 13:36
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.

1 participant