Description of changes:
The previous pagination of get_log_events could drop events when there were large numbers of events written with the same timestamp as the runs lastEventTimeStamp. Because of the large page sizes of CloudWatch you only see this in very large runs.
This fix adds an explicit endTime to the request which is the last event timestamp of the run. This constrains the logstream to have a finish so that when done it will return a nextForwardToken equal to the value of the token passed in the request. Without an explicit endTime the nextForwardToken is never the same and you are essentially tailing the log forever.
The fix simplifies the logic and also removes a dangerous place where exceptions can be swallowed.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Description of changes: The previous pagination of
get_log_events
could drop events when there were large numbers of events written with the sametimestamp
as the runslastEventTimeStamp
. Because of the large page sizes of CloudWatch you only see this in very large runs.This fix adds an explicit
endTime
to the request which is the last event timestamp of the run. This constrains the logstream to have a finish so that when done it will return anextForwardToken
equal to the value of the token passed in the request. Without an explicitendTime
thenextForwardToken
is never the same and you are essentially tailing the log forever.The fix simplifies the logic and also removes a dangerous place where exceptions can be swallowed.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.