Fix pull manager retry (#12907)

This commit is contained in:
Alex Wu
2020-12-16 14:18:43 -08:00
committed by GitHub
parent c677b9e201
commit 8b783ecafa
3 changed files with 55 additions and 11 deletions
+12 -9
View File
@@ -89,14 +89,7 @@ ObjectManager::ObjectManager(asio::io_service &main_service, const NodeID &self_
static_cast<int64_t>(1L),
static_cast<int64_t>(config_.max_bytes_in_flight / config_.object_chunk_size))));
pull_retry_timer_.async_wait([this](const boost::system::error_code &e) {
RAY_CHECK(!e) << "The raylet's object manager has failed unexpectedly with error: "
<< e
<< ". Please file a bug report on here: "
"https://github.com/ray-project/ray/issues";
Tick();
});
pull_retry_timer_.async_wait([this](const boost::system::error_code &e) { Tick(e); });
if (plasma::plasma_store_runner) {
store_notification_ = std::make_shared<ObjectStoreNotificationManager>(main_service);
@@ -814,6 +807,16 @@ void ObjectManager::RecordMetrics() const {
stats::ObjectManagerPullRequests().Record(pull_manager_->NumActiveRequests());
}
void ObjectManager::Tick() { pull_manager_->Tick(); }
void ObjectManager::Tick(const boost::system::error_code &e) {
RAY_CHECK(!e) << "The raylet's object manager has failed unexpectedly with error: " << e
<< ". Please file a bug report on here: "
"https://github.com/ray-project/ray/issues";
pull_manager_->Tick();
auto interval = boost::posix_time::milliseconds(config_.timer_freq_ms);
pull_retry_timer_.expires_from_now(interval);
pull_retry_timer_.async_wait([this](const boost::system::error_code &e) { Tick(e); });
}
} // namespace ray
+1 -2
View File
@@ -284,7 +284,7 @@ class ObjectManager : public ObjectManagerInterface,
/// Record metrics.
void RecordMetrics() const;
void Tick();
void Tick(const boost::system::error_code &e);
private:
friend class TestObjectManager;
@@ -458,7 +458,6 @@ class ObjectManager : public ObjectManagerInterface,
const RestoreSpilledObjectCallback restore_spilled_object_;
/// Pull manager retry timer .
/* std::unique_ptr<boost::asio::deadline_timer> pull_retry_timer_; */
boost::asio::deadline_timer pull_retry_timer_;
/// Object push manager.