diff options
author | Shreyas Kalyan <shreyas.kalyan@mongodb.com> | 2019-10-21 14:46:57 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-21 14:46:57 +0000 |
commit | 6daa36018a6bd26c1353a49fd6cd42fd3aa1add1 (patch) | |
tree | 9bf0cfec2cc535e7cb605b29c4644d827c270515 | |
parent | 186079301dc9de56313f5a8e84e6088fec289ded (diff) | |
download | mongo-6daa36018a6bd26c1353a49fd6cd42fd3aa1add1.tar.gz |
SERVER-43579 Make AWS KMS support robust to KMS availability
-rw-r--r-- | src/mongo/shell/kms_aws.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/shell/kms_aws.cpp b/src/mongo/shell/kms_aws.cpp index 1417b847781..34b185a4f62 100644 --- a/src/mongo/shell/kms_aws.cpp +++ b/src/mongo/shell/kms_aws.cpp @@ -342,9 +342,15 @@ void AWSConnection::connect(const HostAndPort& host) { str::stream() << "AWS KMS server address " << host.host() << " is invalid.", server.isValid()); + int attempt = 0; + bool connected = false; + while ((connected == false) && (attempt < 3)) { + connected = _socket->connect(server); + attempt++; + } uassert(51137, str::stream() << "Could not connect to AWS KMS server " << server.toString(), - _socket->connect(server)); + connected); uassert(51138, str::stream() << "Failed to perform SSL handshake with the AWS KMS server " |