[backport 3.2] netbox: reduce spam in netbox logs#12047
Merged
sergepetrenko merged 1 commit intorelease/3.2from Nov 20, 2025
Merged
[backport 3.2] netbox: reduce spam in netbox logs#12047sergepetrenko merged 1 commit intorelease/3.2from
sergepetrenko merged 1 commit intorelease/3.2from
Conversation
Before this patch a lot of "Connection refused" records were printed in log files during netbox connection. This happened in two general situations: 1) Current instance tries to connect to non-existent instance. 2) Current instance loses a succeeded connection to another instance. The spam in logs was appearing because we didn't have any logic in `netbox_worker_f` which would control periodic errors' logging during netbox connection. Now, we fix this issue by passing a whole error object into lua stack instead of errmsg and changing logic of errors' displaying in `new_sm` netbox lua function. We display error in "warning" mode only if 1) This error is the first one in netbox session. 2) Current and previous error has different types (codes). 3) Current and previous error has different messages and different types of parent error. Otherwise, current error will be repeated in "verbose" mode. Closes #10506 NO_DOC=bugfix (cherry picked from commit 2c27c9e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(This PR is a backport of #11727 to
release/3.2to a future3.2.3release.)Before this patch a lot of "Connection refused" records were printed in
log files during netbox connection. This happened in two general
situations:
The spam in logs was appearing because we didn't have any logic in
netbox_worker_fwhich would control periodic errors' logging duringnetbox connection.
Now, we fix this issue by passing a whole error object into lua stack
instead of errmsg and changing logic of errors' displaying in
new_smnetbox lua function. We display error in "warning" mode only if
of parent error.
Otherwise, current error will be repeated in "verbose" mode. Also we print
an information about how many seconds it will take to reconnect (after
Connection refusederror).Closes #10506
NO_DOC=bugfix