You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Ken Giusti (JIRA)" <ji...@apache.org> on 2019/06/24 13:42:00 UTC
[jira] [Created] (DISPATCH-1373) the log system mutex is held far
too long
Ken Giusti created DISPATCH-1373:
------------------------------------
Summary: the log system mutex is held far too long
Key: DISPATCH-1373
URL: https://issues.apache.org/jira/browse/DISPATCH-1373
Project: Qpid Dispatch
Issue Type: Bug
Components: Router Node
Affects Versions: 1.8.0
Reporter: Ken Giusti
Fix For: 1.9.0
The log code holds the log mutex(s) too long. Depending on the log level (trace+ is worst) the lock has been observed being held for > 30 milliseconds.
The log lock is a singleton that is acquired by all calls to qd_log (active log level only) - which means it is a global lock.
It appears as if the lock is held while doing I/O and alloc/dealloc'ing memory - which may be expensive (in qd_vlog_impl() in log.c):
{{ // Bounded buffer of log entries, keep most recent.}}
{{ *sys_mutex_lock(log_lock);*}}
{{ qd_log_entry_t *entry = new_qd_log_entry_t();}}
{{ DEQ_ITEM_INIT(entry);}}
{{ entry->module = source->module;}}
{{ entry->level = level;}}
{{ entry->file = file ? strdup(file) : 0;}}
{{ entry->line = line;}}
{{ gettimeofday(&entry->time, NULL);}}
{{ vsnprintf(entry->text, TEXT_MAX, fmt, ap);}}
{{ write_log(source, entry);}}
{{ DEQ_INSERT_TAIL(entries, entry);}}
{{ if (DEQ_SIZE(entries) > LIST_MAX)}}
{{ qd_log_entry_free_lh(DEQ_HEAD(entries));}}
{{ *sys_mutex_unlock(log_lock);*}}{{}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org