This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 5335f8098c fixed for app locking issues (#7352)
5335f8098c is described below

commit 5335f8098c27d07be4aba924b7e4503c258f3e2a
Author: Joe Pappano <[email protected]>
AuthorDate: Thu Feb 16 15:30:55 2023 -0500

    fixed for app locking issues (#7352)
    
    * added error message for app lock and defered unlock
    
    * added changelog entry
---
 CHANGELOG.md                        | 1 +
 cache-config/t3c-apply/t3c-apply.go | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c12dcd8740..f4c6f1517b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -81,6 +81,7 @@ The format is based on [Keep a 
Changelog](http://keepachangelog.com/en/1.0.0/).
 - [#7277](https://github.com/apache/trafficcontrol/pull/7277) *Traffic Control 
Cache Config (t3c)* remapdotconfig: remove skip check at mids for nocache/live
 - [#7282](https://github.com/apache/trafficcontrol/pull/7282) *Traffic Ops* 
Fixed issue with user getting correctly logged when using an access or bearer 
token authentication.
 - [#7346](https://github.com/apache/trafficcontrol/pull/7346) *Traffic Control 
Cache Config (t3c)* Fixed issue with stale lock file when using git to track 
changes.
+- [#7352](https://github.com/apache/trafficcontrol/pull/7352) *Traffic Control 
Cache Config (t3c)* Fixed issue with application locking which would allow 
multiple instances of *t3c apply* to run concurrently.
 
 ## [7.0.0] - 2022-07-19
 ### Added
diff --git a/cache-config/t3c-apply/t3c-apply.go 
b/cache-config/t3c-apply/t3c-apply.go
index 959d9f4a58..d543705610 100644
--- a/cache-config/t3c-apply/t3c-apply.go
+++ b/cache-config/t3c-apply/t3c-apply.go
@@ -107,9 +107,11 @@ func Main() int {
                        log.Infoln(FailureExitMsg)
                        return ExitCodeAlreadyRunning
                }
+               log.Errorf("Unable to acquire app lock retrying in: %v ", 
LockFileRetryInterval)
                time.Sleep(LockFileRetryInterval)
        }
        log.Infoln("Acquired app lock")
+       defer lock.Unlock()
 
        // Note failing to load old metadata is not fatal!
        // oldMetaData must always be checked for nil before usage!

Reply via email to