danmx / sigil

AWS SSM Session manager client
Apache License 2.0
69 stars 13 forks source link

fix(aws): reducing timeouts to speed up error feedback loop #144

Closed danmx closed 4 years ago

danmx commented 4 years ago

I've noticed extremely slow error feedback loop e.g. for broken credentials. I decided to keep a feedback loop significantly faster for non-throttled errors.

Benchmarked with an expired token errors (non-throttled):

$ hyperfine -i 'bazel-out/darwin-fastbuild-ST-cff33a8e9d06/bin/dev/sigil --region eu-central-1 --log-level fatal ls'
Benchmark #1: bazel-out/darwin-fastbuild-ST-cff33a8e9d06/bin/dev/sigil --region eu-central-1 --log-level fatal ls
  Time (mean ± σ):      1.621 s ±  2.044 s    [User: 13.7 ms, System: 41.3 ms]
  Range (min … max):    0.852 s …  7.436 s    10 runs

For throttled environments it should still capable to work without errors (CC: @klauern) even though times and number of retries are reduced.

codecov[bot] commented 4 years ago

Codecov Report

Merging #144 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #144   +/-   ##
=======================================
  Coverage   19.61%   19.61%           
=======================================
  Files           9        9           
  Lines         627      627           
=======================================
  Hits          123      123           
  Misses        479      479           
  Partials       25       25           
Impacted Files Coverage Δ
pkg/aws/aws.go 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 439adff...6f7af9e. Read the comment docs.