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

Fix/initsteps race condition #8145

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

ak88
Copy link
Contributor

@ak88 ak88 commented Jan 31, 2025

Fixes #8122

Changes

When a IStep fails it can cause the main process to hang in an Autoreset Event.
I have refactored the flow in EthereumStepsManager to be based on awaitable tasks instead, avoiding any race conditions and greatly simplyfying it.

  • List the changes
  • Steps and their dependencies are handled with Task instead of reset event.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

@ak88 ak88 marked this pull request as ready for review January 31, 2025 12:38
@LukaszRozmej LukaszRozmej requested a review from asdacap January 31, 2025 15:06

public async Task Execute(IEnumerable<Task> dependentSteps, CancellationToken cancellationToken)
{
cancellationToken.Register(() => _taskCompletedSource.TrySetCanceled());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this logic into EthereumStepsManager? Like, keep IStep(s) as is.

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.

Sometimes client hangs in startup, when a required plugin fails to load.
2 participants