Add logging for exiting due to timeout
Closed this issue · 0 comments
doconnor-clintel commented
We initially set up the scaler and it was running in <10s; so we added a trigger to run every 20 minutes/on pull request; and set LAMBDA_TIMEOUT
to 15s.
Over time, performance slowed; and soon we were accidentally hitting our timeout.
Logs showed only:
START RequestId: de0b3237-a64e-4226-b4e3-9db81cba60ba Version: $LATEST
2022/11/14 00:19:50 buildkite-agent-scaler version 1.3.2 dev
2022/11/14 00:20:08 Succesfully retrieved last scaling activity events. Last scale out 2022-11-11 07:47:55.396 +0000 UTC, last scale in 0001-01-01 00:00:00 +0000 UTC. Discovery took 17.109240023s.
END RequestId: de0b3237-a64e-4226-b4e3-9db81cba60ba
REPORT RequestId: de0b3237-a64e-4226-b4e3-9db81cba60ba Duration: 17145.01 ms Billed Duration: 17146 ms Memory Size: 128 MB Max Memory Used: 47 MB Init Duration: 107.13 ms
This was confusing; as it decided to "silently" exit; otherwise looking successful; due to:
https://github.com/buildkite/buildkite-agent-scaler/blob/master/lambda/main.go#L190
Logging prior to exit - "LAMBDA_TIMEOUT reached, exiting" would have made this more discoverable.