You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/11/08 17:08:36 UTC

[GitHub] [trafficcontrol] jrushford opened a new pull request #6341: Changes the t3c process locking so that no two simultaneous t3c instances run.

jrushford opened a new pull request #6341:
URL: https://github.com/apache/trafficcontrol/pull/6341


   Changes the t3c process locking so that no two simultaneous t3c instances run. The locking now occurs before t3c attempts logging into traffic ops.
   
   <!-- **^ Add meaningful description above** --><hr>
   
   ## Which Traffic Control components are affected by this PR?
   
   - Traffic Control Cache Config (T3C, formerly ORT)
   
   ## What is the best way to verify this PR?
   
   Try to start two or more t3c-apply processes on the same machine.  Only one will run, the others should
   exit with a log message indicating another t3c-apply process is already running.
   
   
   ## PR submission checklist
   - [x] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
   - [x] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
   - [x] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should have a changelog entry. -->
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] jrushford commented on a change in pull request #6341: Changes the t3c process locking so that no two simultaneous t3c instances run.

Posted by GitBox <gi...@apache.org>.
jrushford commented on a change in pull request #6341:
URL: https://github.com/apache/trafficcontrol/pull/6341#discussion_r747569131



##########
File path: cache-config/t3c-apply/t3c-apply.go
##########
@@ -69,6 +69,9 @@ func main() {
 	} else if cfg == (config.Cfg{}) { // user used the --help option
 		os.Exit(Success)
 	}
+	if !lock.GetLock("/var/run/t3c.lock") {

Review comment:
       @rob05c Not in my opinion.  The idea with the locking is limit t3c processes and logins to TO.  Why allow a t3c process running in ReportOnly, it still has to login to TO.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #6341: Changes the t3c process locking so that no two simultaneous t3c instances run.

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #6341:
URL: https://github.com/apache/trafficcontrol/pull/6341#discussion_r747071723



##########
File path: cache-config/t3c-apply/t3c-apply.go
##########
@@ -69,6 +69,9 @@ func main() {
 	} else if cfg == (config.Cfg{}) { // user used the --help option
 		os.Exit(Success)
 	}
+	if !lock.GetLock("/var/run/t3c.lock") {

Review comment:
       Does this need a `if !cfg.ReportOnly {` check like the old code had, to allow running in Report Mode while syncds runs?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] jrushford commented on a change in pull request #6341: Changes the t3c process locking so that no two simultaneous t3c instances run.

Posted by GitBox <gi...@apache.org>.
jrushford commented on a change in pull request #6341:
URL: https://github.com/apache/trafficcontrol/pull/6341#discussion_r747569131



##########
File path: cache-config/t3c-apply/t3c-apply.go
##########
@@ -69,6 +69,9 @@ func main() {
 	} else if cfg == (config.Cfg{}) { // user used the --help option
 		os.Exit(Success)
 	}
+	if !lock.GetLock("/var/run/t3c.lock") {

Review comment:
       Not in my opinion.  The idea with the locking is limit t3c processes and logins to TO.  Why allow a t3c process running in ReportOnly, it still has to login to TO.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rob05c merged pull request #6341: Changes the t3c process locking so that no two simultaneous t3c instances run.

Posted by GitBox <gi...@apache.org>.
rob05c merged pull request #6341:
URL: https://github.com/apache/trafficcontrol/pull/6341


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org