Skip to content

Avoid locks in DiagsError when target is syslog #7374

@c-taylor

Description

@c-taylor

Various thread wide warn/note messages cause excessive lock contention.

I note from:
include/tscore/Diags.h
src/tscore/Diags.cc

That note() and other messages have an explicit lock. This is a problem on busy systems when there are:

  • Many threads
  • Messages that cause all thread to log simultaneously occur.

In many cases, the types of messages that occur simultaneously are due to error or load events. Ironically this is made worse by the current structure. Change here may improve Diag::Log overhead/behaviour also...

Such messages include:

  • Log disks full
  • NOTE: Failure threshold met failcount

A lock should not be required when we know the target is syslog (possibly other types also).
A few suggestions:

  • Move the syslog conditional to the head of the logic
  • Apply conditionals to the lock semantics
  • Move the locks into the existing conditionals

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions