Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pipeline {
}
axis {
name 'GO_VERSION'
values '1.14', '1.15', '1.16'
values '1.15', '1.16', '1.17'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: bumping the go versions -- since the extension is compiled down to machine code it should run in Amazon's Linux environments regardless of which version we use to compile it. So I don't see any issues in dropping support for 1.14 from our perspective.

The one possible negative tradeoff here is if a user's compiling their own extension and if that user doesn't have easy access to go 1.15 or greater, we'd might be leaving them behind if we start using go 1.15+ features.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a slack convo we decided we'll address older version support if the need comes up later on.

}
}
stages {
Expand Down
9 changes: 4 additions & 5 deletions apm-lambda-extension/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,11 @@ func main() {
}()

// Calculate how long to wait for a runtimeDone event
funcTimeout := time.Unix(0, event.DeadlineMs*int64(time.Millisecond))
msBeforeFuncTimeout := 100 * time.Millisecond
timeToWait := funcTimeout.Sub(time.Now()) - msBeforeFuncTimeout
flushDeadlineMs := event.DeadlineMs - 100
durationUntilFlushDeadline := time.Until(time.Unix(flushDeadlineMs/1000, 0))

// Create a timer that expires after timeToWait
timer := time.NewTimer(timeToWait)
// Create a timer that expires after durationUntilFlushDeadline
timer := time.NewTimer(durationUntilFlushDeadline)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 User of Time.Until is definitely clearer.

defer timer.Stop()

select {
Expand Down