awslabs / amazon-omics-tools

Apache License 2.0
24 stars 6 forks source link

Fix for dropped events #67

Closed markjschreiber closed 2 months ago

markjschreiber commented 2 months ago

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.