Skip to content

Commit

Permalink
Merge pull request #2397 from cloudfoundry/fix-nats-race-condition
Browse files Browse the repository at this point in the history
Fix race condition between NATS sync and reload
  • Loading branch information
lnguyen authored Sep 12, 2022
2 parents 0c955f8 + 59a3a13 commit 1d63f03
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions jobs/nats/monit
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ check process nats
stop program "/var/vcap/jobs/bpm/bin/bpm stop nats"
group vcap

check file nats_auth_conf
with path /var/vcap/data/nats/auth.json
if changed checksum then exec "/var/vcap/packages/nats/bin/nats-server --signal reload=/var/vcap/sys/run/bpm/nats/nats.pid"

check process bosh_nats_sync
with pidfile /var/vcap/sys/run/bpm/nats/bosh_nats_sync.pid
start program "/var/vcap/jobs/bpm/bin/bpm start nats -p bosh_nats_sync"
stop program "/var/vcap/jobs/bpm/bin/bpm stop nats -p bosh_nats_sync"
group vcap

check file nats_auth_conf
with path /var/vcap/data/nats/auth.json
if changed checksum then exec "/var/vcap/packages/nats/bin/nats-server --signal reload=/var/vcap/sys/run/bpm/nats/nats.pid"
depends on nats_auth_conf

0 comments on commit 1d63f03

Please sign in to comment.