[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25812=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25812 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 21/Jul/16 17:35 Start Date: 21/Jul/16 17:35 Worklog Time Spent: 10m Work Description: Github user zwoop closed the pull request at: https://github.com/apache/trafficserver/pull/815 Issue Time Tracking --- Worklog Id: (was: 25812) Time Spent: 2h 10m (was: 2h) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 2h 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25793=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25793 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 21/Jul/16 05:53 Start Date: 21/Jul/16 05:53 Worklog Time Spent: 10m Work Description: Github user jpeach commented on the issue: https://github.com/apache/trafficserver/pull/815 Issue Time Tracking --- Worklog Id: (was: 25793) Time Spent: 2h (was: 1h 50m) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 2h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25773=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25773 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 20/Jul/16 20:39 Start Date: 20/Jul/16 20:39 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/815 Linux build *successful*! See https://ci.trafficserver.apache.org/job/Github-Linux/358/ for details. Issue Time Tracking --- Worklog Id: (was: 25773) Time Spent: 1h 50m (was: 1h 40m) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 1h 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25772=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25772 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 20/Jul/16 20:33 Start Date: 20/Jul/16 20:33 Worklog Time Spent: 10m Work Description: Github user atsci commented on the issue: https://github.com/apache/trafficserver/pull/815 FreeBSD build *successful*! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/462/ for details. Issue Time Tracking --- Worklog Id: (was: 25772) Time Spent: 1h 40m (was: 1.5h) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 1h 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25771=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25771 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 20/Jul/16 20:22 Start Date: 20/Jul/16 20:22 Worklog Time Spent: 10m Work Description: Github user zwoop commented on the issue: https://github.com/apache/trafficserver/pull/815 Yeah, like that. Makes you wonder why TSPluginDirGet() was so different though ... I've had issues before with these APIs, where transfer of ownership was not clear. I'll take a peek in a bit. [approve ci]. Issue Time Tracking --- Worklog Id: (was: 25771) Time Spent: 1.5h (was: 1h 20m) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 1.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25740=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25740 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 20/Jul/16 05:40 Start Date: 20/Jul/16 05:40 Worklog Time Spent: 10m Work Description: Github user yatsukhnenko commented on the issue: https://github.com/apache/trafficserver/pull/815 @zwoop, @jpeach, something like this? Issue Time Tracking --- Worklog Id: (was: 25740) Time Spent: 1h 20m (was: 1h 10m) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 1h 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25738=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25738 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 20/Jul/16 03:36 Start Date: 20/Jul/16 03:36 Worklog Time Spent: 10m Work Description: Github user zwoop commented on the issue: https://github.com/apache/trafficserver/pull/815 Gotcha. Well, you showed me C++11 has this requirement for thread safety, and we've said that v7.0.0 will require C++11 support, so +1 on that. Issue Time Tracking --- Worklog Id: (was: 25738) Time Spent: 1h 10m (was: 1h) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 1h 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25736=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25736 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 20/Jul/16 03:21 Start Date: 20/Jul/16 03:21 Worklog Time Spent: 10m Work Description: Github user jpeach commented on the issue: https://github.com/apache/trafficserver/pull/815 File scope would not work since these initializers can depend on librecords. Issue Time Tracking --- Worklog Id: (was: 25736) Time Spent: 1h (was: 50m) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 1h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25735=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25735 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 20/Jul/16 03:02 Start Date: 20/Jul/16 03:02 Worklog Time Spent: 10m Work Description: Github user zwoop commented on the issue: https://github.com/apache/trafficserver/pull/815 If I understand C++ at all, I don't think that example is thread safe? But, moving it outside (file scope) would be. No? Issue Time Tracking --- Worklog Id: (was: 25735) Time Spent: 50m (was: 40m) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25731=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25731 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 20/Jul/16 00:57 Start Date: 20/Jul/16 00:57 Worklog Time Spent: 10m Work Description: Github user zwoop commented on the issue: https://github.com/apache/trafficserver/pull/815 Interesting, so e.g. static char *runtimedir = RecConfigReadRuntimeDir(); would be thread safe. That seems like a no-brainer to me :). +1 Issue Time Tracking --- Worklog Id: (was: 25731) Time Spent: 40m (was: 0.5h) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25726=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25726 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 19/Jul/16 23:54 Start Date: 19/Jul/16 23:54 Worklog Time Spent: 10m Work Description: Github user jpeach commented on the issue: https://github.com/apache/trafficserver/pull/815 These are globals, so I don't think that thread local storage makes sense here. There are 2 reasonable approaches to this. The most straight-forward is to use static initialization (which is guaranteed to be thread-safe by the [language](http://en.cppreference.com/w/cpp/language/storage_duration)). Alternatively, we could use ``pthread_once`` directly. For example, using the first alternative: ```C const char * TSFooDirGet() { static const char * path = ReadFooDirPath(); return path; } ``` Issue Time Tracking --- Worklog Id: (was: 25726) Time Spent: 0.5h (was: 20m) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 0.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25725=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25725 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 19/Jul/16 20:45 Start Date: 19/Jul/16 20:45 Worklog Time Spent: 10m Work Description: Github user zwoop commented on the issue: https://github.com/apache/trafficserver/pull/815 @jpeach Wdyt? Would TLS make more sense here? It would duplicate those static strings, but avoids locks, no ? Issue Time Tracking --- Worklog Id: (was: 25725) Time Spent: 20m (was: 10m) > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Work logged] (TS-4680) Not thread safe initialization in TS*DirGet() functions
[ https://issues.apache.org/jira/browse/TS-4680?focusedWorklogId=25724=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25724 ] ASF GitHub Bot logged work on TS-4680: -- Author: ASF GitHub Bot Created on: 19/Jul/16 20:17 Start Date: 19/Jul/16 20:17 Worklog Time Spent: 10m Work Description: GitHub user yatsukhnenko opened a pull request: https://github.com/apache/trafficserver/pull/815 TS-4680: thread safe initialization in TS*DirGet() functions @zwoop, @jpeach, review please. I'm not sure about that. You can merge this pull request into a Git repository by running: $ git pull https://github.com/yatsukhnenko/trafficserver TS-4680 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/trafficserver/pull/815.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #815 commit f4ae4ebb01d805029efd498c7df5e7b4cb5a345b Author: Pavlo YatsukhnenkoDate: 2016-07-19T18:11:04Z TS-4680: thread safe initialization in TS*DirGet() functions Issue Time Tracking --- Worklog Id: (was: 25724) Time Spent: 10m Remaining Estimate: 0h > Not thread safe initialization in TS*DirGet() functions > --- > > Key: TS-4680 > URL: https://issues.apache.org/jira/browse/TS-4680 > Project: Traffic Server > Issue Type: Bug > Components: TS API >Reporter: Pavlo Yatsukhnenko > Time Spent: 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v6.3.4#6332)