Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexerService should use is_cancelled() to check if ckb received Ctrl-C signal #4348

Merged

Conversation

eval-exec
Copy link
Collaborator

…trl-c signal

What problem does this PR solve?

Problem Summary:
In #4345, the tokio::select! will stuck forever if ckb doesn't received ctrl-C signal. Should use stop.is_canceled().

What's Changed:

Related changes

  • use stop.is_canceled() to check if ckb has received exit signal.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • None

Release note

Title Only: Include only the PR title in the release note.

@eval-exec eval-exec requested a review from a team as a code owner February 9, 2024 02:27
@eval-exec eval-exec requested review from doitian and removed request for a team February 9, 2024 02:27
@eval-exec eval-exec requested review from quake and EthanYuan February 9, 2024 02:47
@quake quake added this pull request to the merge queue Feb 9, 2024
Merged via the queue into nervosnetwork:develop with commit 2615601 Feb 9, 2024
33 checks passed
@doitian doitian mentioned this pull request Mar 18, 2024
},
else => {},
if stop.is_cancelled() {
info!("Indexer received exit signal, cancel new_block_watcher task, exit now");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if use rich-indexer,this content need update? auto get indexer type which is using

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed. The version of CKB that includes rich-indexer has been refactored, and this check is moved to the module indexer-sync, which is common to both indexer and rich-indexer.

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.

4 participants