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
223
timer:=time.NewTimer(durationUntilFlushDeadline)
215
224
defertimer.Stop()
216
225
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
-
226
+
// The extension relies on 3 independent mechanisms to minimize the time interval
227
+
// between the end of the execution of the lambda function and the end of the
228
+
// execution of processEvent():
229
+
// 1) AgentDoneSignal triggered upon reception of a `flushed=true` query from the agent
230
+
// 2) [Backup 1] All expected log events are processed.
231
+
// 3) [Backup 2] If all else fails, the extension relies of the timeout of the Lambda
232
+
// function to interrupt itself 200ms before the specified deadline to give the extension
233
+
// time to flush data before shutdown.
224
234
select {
225
235
case<-app.apmClient.WaitForFlush():
226
236
app.logger.Debug("APM client has sent flush signal")
227
-
case<-runtimeDone:
237
+
case<-logProcessingDone:
228
238
app.logger.Debug("Received runtimeDone signal")
229
239
case<-timer.C:
230
-
app.logger.Info("Time expired waiting for agent signal or runtimeDone event")
240
+
app.logger.Info("Time expired while waiting for final log event")
0 commit comments