Skip to content

Commit d7d1618

Browse files
committed
chore: add logging, for troubleshooting
1 parent 1b0246b commit d7d1618

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

shared/packages/worker/src/workerAgent.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -901,19 +901,26 @@ export class WorkerAgent {
901901
private intervalErrorCheck() {
902902
if (this.failureCounter === 0) {
903903
// reset the failurePeriodCounter when there were no exceptions in the period
904+
905+
this.logger.debug(
906+
`Worker ErrorCheck: There was a period with 0 errors, resetting failurePeriodCounter (from ${this.failurePeriodCounter})`
907+
)
904908
this.failurePeriodCounter = 0
905909
// everything seems fine
906910
return
907911
}
908912

909913
if (this.failureCounter > 0) {
910914
this.failurePeriodCounter++
915+
this.logger.debug(
916+
`Worker ErrorCheck: There was a period with ${this.failureCounter} errors, incrementing failurePeriodCounter (to ${this.failurePeriodCounter})`
917+
)
911918
this.failureCounter = 0
912919
}
913920

914921
if (this.failurePeriodCounter >= this.config.worker.failurePeriodLimit) {
915922
this.logger.error(
916-
`Worker: Failed failurePeriodLimit check: ${this.failurePeriodCounter} periods with errors. Requesting spin down.`
923+
`Worker ErrorCheck: Failed failurePeriodLimit check: ${this.failurePeriodCounter} periods with errors. Requesting spin down.`
917924
)
918925
this.requestShutDown(true)
919926
}

0 commit comments

Comments
 (0)