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

ModuleLoader: Run defered operations in the same routine #718

Closed
wants to merge 3 commits into from

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Nov 18, 2021

Previously we ran Defer as part of a separate goroutine because there were occasionally blocking operations scheduled and waited for as part of Defer, which could in turn result in a deadlock with the originating operation.

As all tasks are now async by default (outside of tests) and tests always block on every operation until it is finished, this presents an opportunity to clean up some tech debt and remove time.Sleep.


The second commit further prevents deadlocks by marking duplicate operations automatically as done.

Previously we ran Defer as part of a separate goroutine because
there were blocking operations scheduled and waited for as part
of defer, which could in turn block the originating operation.

As all tasks are now async by default and tests always block
on *every* operation until it is finished, this presents
an opportunity to clean up some tech debt and remove `time.Sleep`.
This is to prevent deadlock in tests, which may still occasionally
end up in a situation where two or more of the same operations
are scheduled at a time.
@radeksimko
Copy link
Member Author

Unfortunately this won't be as simple as I thought - some tests still seem to end up in a deadlock 😑

Filed #719 and closing this for now.

@radeksimko radeksimko closed this Nov 18, 2021
@radeksimko radeksimko deleted the f-defer-sync branch November 18, 2021 11:36
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant