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

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

Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/568#issuecomment-210501721
  
    I don't see any reason to block writing tests on some proposed framework. 
All you really need to write a test is a hook to run it (which we have) and a 
way to check state (which we have). I think that is is possible to write an 
actual unit test for this, focusing on just the ``Diags`` class, but for now 
I'd also be ok with a shell-script or something like what we used for testing 
access log rolling in the first iteration of TSQA.
    
    Off the top of my head, how about a test that starts a few threads writing 
diagnostics, then a second set of threads that continually rebinds ``stderr`` 
and ``stdout`` to ``/dev/null``?


> 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