This is an automated email from the ASF dual-hosted git repository.
tross pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new 933b9df DISPATCH-1289 - Only generate terminus strings if INFO logging is on. Resolve
race condition in which the IO thread might free a terminus before the core thread logs the
text.
933b9df is described below
commit 933b9df940983282067033e05b46e9665a266058
Author: Ted Ross <tross@redhat.com>
AuthorDate: Fri Mar 15 16:27:37 2019 -0400
DISPATCH-1289 - Only generate terminus strings if INFO logging is on. Resolve race condition
in which the IO thread might free a terminus before the core thread logs the text.
---
src/router_core/connections.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/router_core/connections.c b/src/router_core/connections.c
index 0c58da4..96f176b 100644
--- a/src/router_core/connections.c
+++ b/src/router_core/connections.c
@@ -1408,6 +1408,23 @@ static void qdr_link_inbound_first_attach_CT(qdr_core_t *core, qdr_action_t
*act
return;
}
+ char source_str[1000];
+ char target_str[1000];
+ size_t source_len = 1000;
+ size_t target_len = 1000;
+
+ source_str[0] = '\0';
+ target_str[0] = '\0';
+
+ //
+ // Grab the formatted terminus strings before we schedule any IO-thread processing that
+ // might get ahead of us and free the terminus objects before we issue the log.
+ //
+ if (qd_log_enabled(core->log, QD_LOG_INFO)) {
+ qdr_terminus_format(source, source_str, &source_len);
+ qdr_terminus_format(target, target_str, &target_len);
+ }
+
if (dir == QD_INCOMING) {
//
// Handle incoming link cases
@@ -1480,14 +1497,6 @@ static void qdr_link_inbound_first_attach_CT(qdr_core_t *core, qdr_action_t
*act
}
}
- char source_str[1000];
- char target_str[1000];
- size_t source_len = 1000;
- size_t target_len = 1000;
-
- qdr_terminus_format(source, source_str, &source_len);
- qdr_terminus_format(target, target_str, &target_len);
-
qd_log(core->log, QD_LOG_INFO, "[C%"PRIu64"][L%"PRIu64"] Link attached: dir=%s source=%s
target=%s",
conn->identity, link->identity, dir == QD_INCOMING ? "in" : "out", source_str,
target_str);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
|