DO NOT MERGE: Kill scheduler on overlay v2#5326
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the in-process Action Scheduler/Action Queues and routes main-thread “actions” through the VirtualClock’s ASIO io_context, consistent with the overlay-v2-shared hypothesis that networking work is handled elsewhere.
Changes:
- Removed
util::Schedulerimplementation and its unit tests. - Simplified
VirtualClockaction posting to enqueuestd::function<void()>and forward them to ASIO, removing scheduler-driven fairness/load-shedding. - Updated
Application/ApplicationImpl/AppConnectormain-thread posting APIs to dropScheduler::ActionType.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/util/Timer.h | Removes scheduler ownership/typing from VirtualClock and updates related comments/APIs. |
| src/util/Timer.cpp | Removes scheduler integration from crank() and posts pending actions directly to ASIO. |
| src/util/test/SchedulerTests.cpp | Deletes scheduler unit tests. |
| src/util/Scheduler.h | Deletes scheduler interface. |
| src/util/Scheduler.cpp | Deletes scheduler implementation. |
| src/process/ProcessManagerImpl.h | Adds missing <map> include for std::map member usage. |
| src/main/ApplicationImpl.h | Updates postOnMainThread signature to remove action type. |
| src/main/ApplicationImpl.cpp | Routes main-thread posts through new VirtualClock::postAction(std::function<void()>&&) API. |
| src/main/Application.h | Updates Application::postOnMainThread signature to remove action type. |
| src/main/AppConnector.h | Updates connector postOnMainThread signature to remove action type. |
| src/main/AppConnector.cpp | Updates connector call-through to match new Application API. |
Comments suppressed due to low confidence (1)
src/util/Timer.cpp:416
- This loop holds mPendingActionQueueMutex while calling asio::post repeatedly. That can unnecessarily block background threads calling postAction(), and it makes the critical section include allocations and executor bookkeeping. Consider swapping the queue into a local variable under the lock, then posting without holding the mutex.
// Transfer any pending actions to ASIO, counting them as "progress" also.
{
LOCK_GUARD(mPendingActionQueueMutex, guard);
while (!mPendingActionQueue.empty())
{
asio::post(mIOContext, std::move(mPendingActionQueue.front()));
mPendingActionQueue.pop();
progressCount++;
}
}
💡 Codex Reviewstellar-core/src/herder/PendingEnvelopes.cpp Lines 603 to 604 in 383f329 When an SCP envelope references a quorum set that is not already cached, this only appends the envelope to stellar-core/overlay/src/main.rs Line 729 in 383f329 When a transaction is learned from a peer, the handler only inserts it into the local Rust mempool. Since only local Core submissions call stellar-core/overlay/src/xdr.rs Line 93 in 383f329 For every stellar-core/src/herder/HerderImpl.cpp Lines 656 to 658 in 383f329 In This callback is invoked by stellar-core/src/herder/HerderImpl.cpp Lines 1616 to 1618 in 383f329
ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d11f6b304
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }; | ||
| use metrics::OverlayMetrics; | ||
|
|
||
| const CONFIGURED_PEER_RECONNECT_INTERVAL: Duration = Duration::from_secs(1); |
There was a problem hiding this comment.
Throttle unresolved peer retries outside the 1s loop
When a configured DNS peer has never resolved or connected, it is absent from peer_hostnames, so every reconnect tick treats it as unknown_addrs and launches another DNS-resolution task, even though spawn_peer_retry_task is already doing exponential backoff for the same unresolved hosts. With this interval at 1s, a slow or missing Kubernetes DNS record will be retried every second (and can overlap for multiple peers), bypassing the intended backoff and potentially issuing duplicate raw dials when it finally resolves; track in-flight/unresolved hosts or leave them solely to the retry task.
Useful? React with 👍 / 👎.
| @@ -1,392 +0,0 @@ | |||
| // Copyright 2020 Stellar Development Foundation and contributors. Licensed | |||
There was a problem hiding this comment.
Remove deleted scheduler files from the VS project
When building through Builds/VisualStudio/stellar-core.vcxproj, the project still references ..\..\src\util\Scheduler.cpp, ..\..\src\util\test\SchedulerTests.cpp, and ..\..\src\util\Scheduler.h; after this deletion those files no longer exist, so the Visual Studio build will fail even though the source files were removed. Please delete the stale project/filter entries along with the scheduler sources.
Useful? React with 👍 / 👎.
This removes the Action Scheduler / Action Queues from core on the overlay-v2-shared branch. The hypothesis here is that it's no longer needed with the overlay process doing all the networking.