From aec95b8c0923b314180025afc2df97d8daa0a4aa Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Thu, 9 Dec 2021 12:57:06 -0800 Subject: [PATCH] Debug "Resource temporarily unavailable" exception in CircleCI (#9276) Summary: This changes write_prepared_transaction_test under CircleCI to print a stack trace on unhandled exception, so that we can debug rare exceptions seen in CircleCI: [ RUN ] TwoWriteQueues/SnapshotConcurrentAccessTest.SnapshotConcurrentAccess/24 .......unknown file: Failure C++ exception with description "Resource temporarily unavailable" thrown in the test body. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9276 Test Plan: manual run test with seeded 'throw', with and without CIRCLECI=true environment variable Reviewed By: ajkr, hx235 Differential Revision: D32996993 Pulled By: pdillinger fbshipit-source-id: e790408ce204b676d3d84a290e41be511b203bfa --- utilities/transactions/write_prepared_transaction_test.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utilities/transactions/write_prepared_transaction_test.cc b/utilities/transactions/write_prepared_transaction_test.cc index 62acbf1f5..b70aeeab7 100644 --- a/utilities/transactions/write_prepared_transaction_test.cc +++ b/utilities/transactions/write_prepared_transaction_test.cc @@ -15,6 +15,7 @@ #include "db/db_impl/db_impl.h" #include "db/dbformat.h" #include "port/port.h" +#include "port/stack_trace.h" #include "rocksdb/db.h" #include "rocksdb/options.h" #include "rocksdb/types.h" @@ -4004,7 +4005,12 @@ TEST_P(WritePreparedTransactionTest, WC_WP_WALForwardIncompatibility) { } // namespace ROCKSDB_NAMESPACE int main(int argc, char** argv) { + ROCKSDB_NAMESPACE::port::InstallStackTraceHandler(); ::testing::InitGoogleTest(&argc, argv); + if (getenv("CIRCLECI")) { + // Looking for backtrace on "Resource temporarily unavailable" exceptions + ::testing::FLAGS_gtest_catch_exceptions = false; + } return RUN_ALL_TESTS(); }