<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">Hello,<div><br></div><div>(sending again with proper subject)</div><div><br></div><div>seeing some weirdness in kamailio logs  while testing kamailio under docker/kubernetes and logging to stderr, not sure if its related to kamailio or the infrastructure itself.</div><div><br></div><div>running in 8 core host, it looks like the write to stderr has some race condition if that's even possible.</div><div><br></div><div>the breaks happen with different processes and i wonder if the <span style="color:rgb(86,156,214);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre-wrap">LOG_FX</span> and <span style="color:rgb(86,156,214);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre-wrap">DPRINT_NON_CRIT</span> macros are responsible for that.</div><div>it looks like 2 different processes could evaluate to true and try to write to stderr at same time. </div><div><br></div><div>two examples</div><div><br></div><div>real output<br></div><div>116(354) INFO: 2022-04-28T18:08:14.476102048Z 3ebe6ff3-1799-4798-baa3-a109df32711d registrar-role.cfg:745 (route_to_external_aor) 117(355) INFO: 2022-04-28T18:08:14.473375226Z 5f2567bf-25bb-4cb1-a306-dc28711d9fcb default.cfg:305 (log_request) to <a href="mailto:sip%3A1117@1.sip-stress.com" target="_blank">sip:1117@1.sip-stress.com</a><br>117(355) INFO: 2022-04-28T18:08:14.476592352Z 5f2567bf-25bb-4cb1-a306-dc28711d9fcb default.cfg:324 (classify_source) end - routing to contact <a href="http://sip:1104@10.23.0.2:9181" target="_blank">sip:1104@10.23.0.2:9181</a><br>originated from internal sources<br></div><div><br></div><div>should be</div><div><div>116(354) INFO: 2022-04-28T18:08:14.476102048Z 3ebe6ff3-1799-4798-baa3-a109df32711d registrar-role.cfg:745 (route_to_external_aor) end - routing to contact <a href="http://sip:1104@10.23.0.2:9181" target="_blank">sip:1104@10.23.0.2:9181</a></div><div>117(355) INFO: 2022-04-28T18:08:14.473375226Z 5f2567bf-25bb-4cb1-a306-dc28711d9fcb default.cfg:305 (log_request) to <a href="mailto:sip%3A1117@1.sip-stress.com" target="_blank">sip:1117@1.sip-stress.com</a><br>117(355) INFO: 2022-04-28T18:08:14.476592352Z 5f2567bf-25bb-4cb1-a306-dc28711d9fcb default.cfg:324 (classify_source) originated from internal sources<br></div><div><br></div></div><div>second example</div><div><br></div><div>real output<br></div><div>71(309) INFO: 2022-04-28T18:08:14.514892167Z <a href="mailto:cid-10440-3@10.21.0.1" target="_blank">cid-10440-3@10.21.0.1</a> default.cfg:304 (log_request) 116(354) INFO: 2022-04-28T18:08:14.521506921Z <a href="mailto:cid-10440-26@10.21.0.1" target="_blank">cid-10440-26@10.21.0.1</a> default.cfg:751 (internal_reply) 200 OK<br></div><div>from <a href="mailto:sip%3A1002@1.sip-stress.com" target="_blank">sip:1002@1.sip-stress.com</a><br></div><div><br></div><div>should be</div><div><div>71(309) INFO: 2022-04-28T18:08:14.514892167Z <a href="mailto:cid-10440-3@10.21.0.1" target="_blank">cid-10440-3@10.21.0.1</a> default.cfg:304 (log_request) from <a href="mailto:sip%3A1002@1.sip-stress.com" target="_blank">sip:1002@1.sip-stress.com</a></div><div>116(354) INFO: 2022-04-28T18:08:14.521506921Z <a href="mailto:cid-10440-26@10.21.0.1" target="_blank">cid-10440-26@10.21.0.1</a> default.cfg:751 (internal_reply) 200 OK</div><div><br></div><div>Any hints/thoughts ?</div><div>should we try to have a better way to handle this inb dprint.c/dprint.h ?</div><div>  <br></div><div><div>Thanks</div><div><br></div></div><div><br></div></div><div><br></div><div><br></div><div><br></div><div><br></div></div>
</div></div>