Skip to content

api: executor version check polls up to the delay; with executor_multi_instance a stopping node keeps the other nodes' executors - #96

Open
EnzinoBB wants to merge 3 commits into
CREDITSCOM:masterfrom
CreditsCommunity:official/executor-version-poll
Open

EnzinoBB wants to merge 3 commits into
CREDITSCOM:masterfrom
CreditsCommunity:official/executor-version-poll

Conversation

@EnzinoBB

@EnzinoBB EnzinoBB commented Nov 1, 2026

Copy link
Copy Markdown

Why this PR

  • checkExecutorVersion slept executor_check_version_delay on the node's start path and asked the executor once, so every start waited the full delay even when the executor was ready earlier.
  • Executor::stop() killed every contract-executor JVM of the machine (jps): with executor_multi_instance, stopping one node killed the executors of the other nodes on the same host.

What changes

  • api/src/executor.cpp: the version check asks every second (cs::pollUntil, new lib/include/lib/system/polluntil.hpp) up to the delay and goes on as soon as the executor answers, with the same outcome as before when it never does. A transport error means "not listening yet" and is retried; any other answer is final; a stop is seen within a second. It stays on the launching thread. The log says how long the answer took, and whether the executor never answered or answered with an error.
  • Executor::stop() terminates only its own executor when executor_multi_instance is set, as checkAnotherExecutor already does at start. The default keeps the current behaviour.

Effect on the network

None: start-up timing and process management of the executor only.

Tests

tests/csnode/polluntil_tests.cpp (new). Built and run on 4a95aaa (GCC 13).

Same change in the community fork: CreditsCommunity#73, running on mainnet community nodes.

EnzinoBB and others added 3 commits November 1, 2026 12:18
…es keep the others' executors

- checkExecutorVersion slept executor_check_version_delay (7 s on mainnet, 60 s in CI) on the
  node's start path and then asked once: it now asks every second (cs::pollUntil) and goes on as
  soon as the executor answers, with the same outcome as before when it never does (terminated);
  a transport error means not listening yet and is retried, any other answer is final; a stop is
  seen within a second. It stays on the launching thread (two threads opening the shared
  transport would be the new risk). The log line says how long the answer took.
- Executor::stop() killed every contract-executor JVM of the machine (jps): with
  executor_multi_instance it now terminates only its own, as checkAnotherExecutor already does at
  start. The default keeps the official behaviour.

Nothing here touches consensus. Found in the scale runs: every node start waited the full delay,
and every restart test relaunched all the executors of the machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s answer in the version check

getExecutorBuildVersion closes the connection on every exception, so 'still connected' never told
an answer from a transport failure: it now sets ThriftException for a transport error (as execute()
does), the poll retries only that, and the log says whether the executor never answered or answered
with an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant