Skip to content

Conversation

kevinAlbs
Copy link
Contributor

@kevinAlbs kevinAlbs commented Nov 13, 2024

Follow-up to 7aeaec4. Calling mongocrypt_kms_ctx_fail with retry disabled is expected to result in an error.

An early return in mongocrypt_kms_ctx_fail returns false to indicate error, but does not set the status:

if (!kms && !kms->retry_enabled) {
    return false;
}

This PR removes the !kms->retry_enabled condition to fall through to the intended error check below:

if (!kms->retry_enabled) {
    CLIENT_ERR("KMS request failed due to network error");
    return false;
}

@kevinAlbs kevinAlbs changed the title Set status if mongocrypt_kms_ctx_fail called with retry disabled MONGOCRYPT-737 set status if mongocrypt_kms_ctx_fail called with retry disabled Nov 13, 2024
@kevinAlbs kevinAlbs marked this pull request as ready for review November 13, 2024 14:07
@kevinAlbs kevinAlbs requested a review from adriandole November 13, 2024 14:07
@kevinAlbs kevinAlbs merged commit 4bde0b8 into mongodb:master Nov 15, 2024
38 of 53 checks passed
kevinAlbs added a commit that referenced this pull request Nov 15, 2024
…try disabled (#908)

* add regression test

* set error status if `mongocrypt_kms_ctx_fail` is called when retry disabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants