Skip to content

Commit

Permalink
Merge pull request #1886 from hashicorp/lock-logger
Browse files Browse the repository at this point in the history
Making the executor lock the logger
  • Loading branch information
diptanu committed Oct 28, 2016
2 parents f0dd21f + 6acfa45 commit 1176e5f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions client/driver/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,15 @@ func (e *UniversalExecutor) UpdateTask(task *structs.Task) error {
e.ctx.Task = task

// Updating Log Config
fileSize := int64(task.LogConfig.MaxFileSizeMB * 1024 * 1024)
e.lro.MaxFiles = task.LogConfig.MaxFiles
e.lro.FileSize = fileSize
e.lre.MaxFiles = task.LogConfig.MaxFiles
e.lre.FileSize = fileSize
e.rotatorLock.Lock()
if e.lro != nil && e.lre != nil {
fileSize := int64(task.LogConfig.MaxFileSizeMB * 1024 * 1024)
e.lro.MaxFiles = task.LogConfig.MaxFiles
e.lro.FileSize = fileSize
e.lre.MaxFiles = task.LogConfig.MaxFiles
e.lre.FileSize = fileSize
}
e.rotatorLock.Unlock()

// Re-syncing task with Consul agent
if e.consulSyncer != nil {
Expand Down

0 comments on commit 1176e5f

Please sign in to comment.