Make session errors look less scary in the logs #5013
Merged
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.
Currently, if a session check fails and a SESSION_INVALID error is raised, the message "Session check failed: missing reference; tbl = session, ref = XX" plus a full strack trace is written to the logs. The stack trace is usually from session_check.ml and looks the same each time.
These logs are not very interesting, but unfortunately attact the attention of people triaging issue by browsing the logs. Because the SESSION_INVALID lines in xapi's logs look so worrying, they often make people suspect bugs in xapi. However, the errors just mean that a client has used an illegal or (more often) expired session. These logs are especially common when the coordinator xapi is restarted and all old sessions are automatically removed.
This patch improves logging of session errors by putting the blame where it belongs: the client (note that clients can be internal). The stack trace is suppressed, and the log line changed as follows: