Skip to content

Commit 597d347

Browse files
authored
Add Error Log if NGINX is not running on Startup (#1531)
1 parent dad4bea commit 597d347

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/plugins/registration.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type OneTimeRegistration struct {
4545
pipeline core.MessagePipeInterface
4646
dataplaneSoftwareDetailsMutex sync.Mutex
4747
processes []*core.Process
48+
logOnce sync.Once
4849
}
4950

5051
func NewOneTimeRegistration(
@@ -186,6 +187,10 @@ func (r *OneTimeRegistration) registerAgent() {
186187
log.Tracef("NGINX non-master process: %d", proc.Pid)
187188
}
188189
}
190+
191+
r.logOnce.Do(func() {
192+
log.Errorf("NGINX master process not found yet, waiting for NGINX to start...")
193+
})
189194
return fmt.Errorf("waiting for NGINX master process... ")
190195
}
191196
err := backoff.WaitUntil(

test/performance/vendor/github.com/nginx/agent/v2/src/plugins/registration.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)