TylerBrock/saw

"Error ThrottlingException: Rate exceeded"

macktab opened this issue · 2 comments

Getting "Error ThrottlingException: Rate exceeded status code: 400, request id: a7d9be90-627d-11e9-9a51-578e1f84b418" from saw.
Maybe, can add some refresh interval for parameter?

In the meanwhile, it's possible to implement a retry with the following script:

(knife is just my custom wrapper for sed)

#!/bin/bash

LOG=$1
CUT="${2:-\[[^]]+\] \([^)]+\)}"
RETRIES="${3:-1}"

# set a bash option so that if any of the piped commands fails, $? will be different than 0
set -o pipefail
# watch logs and trim part of the output
saw watch "$LOG" | knife "$CUT"
# if the pipe fails and retries are within a reasonable number, retry
if [[ $? -ne 0 ]] && (("$RETRIES" <= 10)) ; then
    sleep 1
    RETRIES=$((RETRIES + 1))    
    echo -en "\nRetrying... $0 \"$LOG\" \"$CUT\" $RETRIES\n"
    $0 "$LOG" "$CUT" $RETRIES
fi

Any update? I'm seeing this issue and it's really hampering my use of the tool