| 3537 | } |
| 3538 | |
| 3539 | Status FinalizeS3() { |
| 3540 | auto instance = GetAwsInstance(); |
| 3541 | // The AWS instance might already be destroyed in case FinalizeS3 |
| 3542 | // is called from an atexit handler (which is a bad idea anyway as the |
| 3543 | // AWS SDK is not safe anymore to shutdown by this time). See GH-44071. |
| 3544 | if (instance == nullptr) { |
| 3545 | return Status::Invalid("FinalizeS3 called too late"); |
| 3546 | } |
| 3547 | instance->Finalize(); |
| 3548 | return Status::OK(); |
| 3549 | } |
| 3550 | |
| 3551 | Status EnsureS3Finalized() { return FinalizeS3(); } |
| 3552 | |