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

ASF GitHub Bot commented on TS-4072:
------------------------------------

Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/568#issuecomment-209663459
  
    OK the locking makes sense to me I think. You have to hold the lock because 
you want to serialize WRT printing output.
    
    ``Diags::rebind_stderr`` and ``Diags::rebind_stdout`` don't need to be part 
of the class interface. You can replace both of these with a single local 
static helper:
    ```C
    bool rebind(int oldfd, int newfd) {
        /* ... error handling ... */
        return dup2(newfd, oldfd) == 0;
    }
    ```
    
    Please write unit tests for this.


> Diagnostic log rolling races
> ----------------------------
>
>                 Key: TS-4072
>                 URL: https://issues.apache.org/jira/browse/TS-4072
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Logging
>            Reporter: James Peach
>            Assignee: Daniel Xu
>             Fix For: 6.2.0
>
>
> When diagnostic logs are rolled, {{Diags::diags_log}} is deleted and replaced 
> with a new log object. Since the global {{diags}} points to a a single 
> {{Diags}} object there is nothing to prevent a different thread logging 
> through this object at the time it is deleted.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to