mirror of
https://github.com/wassname/ray.git
synced 2026-09-09 11:32:43 +08:00
Error-checking for a couple of corruption issues (#8059)
* Extra error handling * Handle connection closed in Redis monitor Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
@@ -152,6 +152,11 @@ void CoreWorkerProcess::EnsureInitialized() {
|
||||
CoreWorker &CoreWorkerProcess::GetCoreWorker() {
|
||||
EnsureInitialized();
|
||||
if (instance_->options_.num_workers == 1) {
|
||||
// TODO(mehrdadn): Remove this when the bug is resolved.
|
||||
// Somewhat consistently reproducible via
|
||||
// python/ray/tests/test_basic.py::test_background_tasks_with_max_calls
|
||||
// with -c opt on Windows.
|
||||
RAY_CHECK(instance_->global_worker_) << "global_worker_ must not be NULL";
|
||||
return *instance_->global_worker_;
|
||||
}
|
||||
auto ptr = current_core_worker_.lock();
|
||||
|
||||
+4
-2
@@ -79,7 +79,8 @@ void RedisAsioClient::operate() {
|
||||
|
||||
void RedisAsioClient::handle_read(boost::system::error_code error_code) {
|
||||
RAY_CHECK(!error_code || error_code == boost::asio::error::would_block ||
|
||||
error_code == boost::asio::error::connection_reset);
|
||||
error_code == boost::asio::error::connection_reset)
|
||||
<< "handle_read(error_code = " << error_code << ")";
|
||||
read_in_progress_ = false;
|
||||
redis_async_context_.RedisAsyncHandleRead();
|
||||
|
||||
@@ -90,7 +91,8 @@ void RedisAsioClient::handle_read(boost::system::error_code error_code) {
|
||||
|
||||
void RedisAsioClient::handle_write(boost::system::error_code error_code) {
|
||||
RAY_CHECK(!error_code || error_code == boost::asio::error::would_block ||
|
||||
error_code == boost::asio::error::connection_reset);
|
||||
error_code == boost::asio::error::connection_reset)
|
||||
<< "handle_write(error_code = " << error_code << ")";
|
||||
write_in_progress_ = false;
|
||||
redis_async_context_.RedisAsyncHandleWrite();
|
||||
|
||||
|
||||
@@ -50,7 +50,11 @@ void RedisAsyncContext::RedisAsyncHandleRead() {
|
||||
// This function will execute the callbacks which are registered by
|
||||
// `redisvAsyncCommand`, `redisAsyncCommandArgv` and so on.
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
|
||||
// TODO(mehrdadn): Remove this when the bug is resolved.
|
||||
// Somewhat consistently reproducible via
|
||||
// python/ray/tests/test_basic.py::test_background_tasks_with_max_calls
|
||||
// with -c opt on Windows.
|
||||
RAY_CHECK(redis_async_context_) << "redis_async_context_ must not be NULL here";
|
||||
redisAsyncHandleRead(redis_async_context_);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user