You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by "George Paul (JIRA)" <ji...@apache.org> on 2010/01/31 19:23:34 UTC

[jira] Commented: (TS-108) unlock in diags code before writing out to syslog

    [ https://issues.apache.org/jira/browse/TS-108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806852#action_12806852 ] 

George Paul commented on TS-108:
--------------------------------

This looks fine. The syslog() function is not in the list of thread-unsafe functions at 
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html#tag_02_09_01
so it should in theory be safe on all platforms. FreeBSD does have syslog_r() which will need to be looked at.
-George 

> unlock in diags code before writing out to syslog
> -------------------------------------------------
>
>                 Key: TS-108
>                 URL: https://issues.apache.org/jira/browse/TS-108
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Logging
>            Reporter: Sean Cosgrave
>            Priority: Minor
>         Attachments: unlock_diff.txt
>
>
> Original bug description from Anirban:
> Currently, diags calls attain a lock on line 285 of libinktomi++/Diags.cc which is then released on line 370 to prevent
> various threads from dumping logs at the same time, thus leading to interleaved and unreadable logs.
> That makes sense in the context of stdout, stderr and Diags own fp based logging. However, it doesnt apply to syslog
> messages, since those are written out to Unix named pipes, which guarantee integrity of the message (and order). Even
> if we were using Unix Domain Sockets to write out the syslogs, that would also ensure the integrity of the message in a
> packet.
> Thus we should unlock before we write out to syslog (around line# 329).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.