You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Create a timer that expires after durationUntilFlushDeadline
214
215
timer:=time.NewTimer(durationUntilFlushDeadline)
215
216
defertimer.Stop()
216
217
217
-
// The extension relies on 3 independent mechanisms to minimize the time interval between the end of the execution of
218
-
// the lambda function and the end of the execution of processEvent()
219
-
// 1) AgentDoneSignal is triggered upon reception of a `flushed=true` query from the agent
220
-
// 2) [Backup 1] RuntimeDone is triggered upon reception of a Lambda log entry certifying the end of the execution of the current function
221
-
// 3) [Backup 2] If all else fails, the extension relies of the timeout of the Lambda function to interrupt itself 200 ms before the specified deadline.
222
-
// This time interval is large enough to attempt a last flush attempt (if SendStrategy == syncFlush) before the environment gets shut down.
223
-
218
+
// The extension relies on 3 independent mechanisms to minimize the time interval
219
+
// between the end of the execution of the lambda function and the end of the
220
+
// execution of processEvent():
221
+
// 1) AgentDoneSignal triggered upon reception of a `flushed=true` query from the agent
222
+
// 2) [Backup 1] All expected log events are processed.
223
+
// 3) [Backup 2] If all else fails, the extension relies of the timeout of the Lambda
224
+
// function to interrupt itself 200ms before the specified deadline to give the extension
225
+
// time to flush data before shutdown.
224
226
select {
225
227
case<-app.apmClient.WaitForFlush():
226
228
app.logger.Debug("APM client has sent flush signal")
227
-
case<-runtimeDone:
229
+
case<-logProcessingDone:
228
230
app.logger.Debug("Received runtimeDone signal")
229
231
case<-timer.C:
230
-
app.logger.Info("Time expired waiting for agent signal or runtimeDone event")
232
+
app.logger.Info("Time expired while waiting for final log event")
0 commit comments