Skip to content

Commit

Permalink
Add ODS counter for fschannel task queue
Browse files Browse the repository at this point in the history
Summary:
I am unbounding the fschannelthread task queue due to a deadlock (see stack)
This adds a counter for the number of tasks queued up for the fschannelthreads.

We will monitor this when we unbound to see how much memory we are using and
ensuring that things are staying reasonable. This will also help inform how
many pending requests we should allow max.

Note that because we don't have ODS on some platforms we will rely on the logging
in D56739177 more heavily for making the max decision.

Reviewed By: MichaelCuevas

Differential Revision: D56739143

fbshipit-source-id: 9c5a17a2a41ce9d9791a04d5154702bf292d1e6e
  • Loading branch information
Katie Mancini authored and facebook-github-bot committed May 1, 2024
1 parent 20c0aed commit 3d94d41
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions eden/common/utils/UnboundedQueueExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,14 @@ UnboundedQueueExecutor::UnboundedQueueExecutor(
std::shared_ptr<folly::ManualExecutor> executor)
: executor_{std::move(executor)} {}

size_t UnboundedQueueExecutor::getTaskQueueSize() const {
if (auto ex =
std::dynamic_pointer_cast<folly::CPUThreadPoolExecutor>(executor_)) {
return ex->getTaskQueueSize();
}
// manual executor does not expose a way to count the number of pending
// tasks.
return 0;
}

} // namespace facebook::eden
2 changes: 2 additions & 0 deletions eden/common/utils/UnboundedQueueExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class UnboundedQueueExecutor : public folly::Executor {
executor_->add(std::move(func));
}

size_t getTaskQueueSize() const;

private:
std::shared_ptr<folly::Executor> executor_;
};
Expand Down

0 comments on commit 3d94d41

Please sign in to comment.