1
0
mirror of https://github.com/facebook/rocksdb.git synced 2026-10-23 08:09:02 +03:00
Files
rocksdb/db_stress_tool/db_stress.cc
Josh Kang 37234200b5 Handle benign io_uring stderr in crash tests (#15181)
Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/15181

A crash test failed when `use_async_db_api=1` created read-executor workers on a host unable to allocate io_uring rings. Folly logged the setup failure and threw; RocksDB caught it and successfully fell back to synchronous reads, but the harness failed because stderr was non-empty.

Representative stderr:

```
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0903 14:05:39.470695 286445 IoUringBackend.cpp:527] io_uring_queue_init_params(512,1024) failed errno = 0:"Success" 0x7d2e06295280 retrying with capacity = 512
E0903 14:05:39.470759 286445 IoUringBackend.cpp:537] io_uring_queue_init_params(512,512) failed ret = -12:"Unknown error -12" 0x7d2e06295280
```

Initialize glog in the Folly-enabled OSS `db_stress` entry point and centralize known stderr sanitization. Only `IoUringBackend` ring-initialization failures are moved to stdout when the async DB API is enabled; existing expected post-SIGTERM errors use the same sanitizer. All unrelated stderr remains fatal.

___

Differential Revision: D118836521

fbshipit-source-id: c9ce05896f417c7723c5cd73d293fbb1cd14ee1e
2026-09-04 12:22:30 -07:00

33 lines
961 B
C++

// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#ifndef GFLAGS
#include <cstdio>
int main() {
fprintf(stderr, "Please install gflags to run rocksdb tools\n");
return 1;
}
#else
#ifdef USE_FOLLY
#include <glog/logging.h>
#endif
#include "port/stack_trace.h"
#include "rocksdb/db_stress_tool.h"
int main(int argc, char** argv) {
#ifdef USE_FOLLY
google::InitGoogleLogging(argv[0]);
#endif
ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
return ROCKSDB_NAMESPACE::db_stress_tool(argc, argv);
}
#endif // GFLAGS