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

feat: separate Exec ctx and Closed ctx #206

Merged

Conversation

derekperkins
Copy link
Contributor

@derekperkins derekperkins commented Jan 2, 2023

feat: add PipelineConcurrency option

This adds a pipeline option to the DMap pipeline interface, which should be backwards compatible. It also changes the default from 1 to runtime.NumCPU(), which from the variable naming, appears to have been the original intent.

fixes #201

feat: separate Exec ctx and Closed ctx

  • fixes a bug where Discard would always return ErrPipelineClosed after calling Exec, making it impossible to reuse it
  • protects FutureXXX calls from panicking or returning stale/invalid data

fixes #205

This is rebased on top of #202 to avoid merge conflicts, so we should either merge that one first, or close it and use this PR for both.

The second commit is extra noisy because the closedCtx field caused indentation changes to happen on all pipeline structs

@derekperkins derekperkins changed the title Invalidate pipeline feat: separate Exec ctx and Closed ctx Jan 2, 2023
@buraksezer
Copy link
Owner

We can close #202 but there is still a problem with the tests. I found the root cause. There is a concurrent access problem in pipeline.go. It's triggered by the new pipeline concurrency option and it seems that it requires a non-trivial review and refactor. I'm on it.

@derekperkins
Copy link
Contributor Author

Cool, thanks for tracking that down. Once that is fixed and this PR merged, I can roll it out again in prod to see if it helps to solve #198

@buraksezer
Copy link
Owner

Hey, @derekperkins I have fixed the data race issue but your branch requires rebase & conflict fix.

@derekperkins
Copy link
Contributor Author

Awesome, I'll fix it up

- fixes a bug where Discard would always return ErrPipelineClosed after calling Exec, making it impossible to reuse it
- protects FutureXXX calls from panicking or returning stale/invalid data
@sonarcloud
Copy link

sonarcloud bot commented Jan 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@buraksezer buraksezer merged commit 3cd69b5 into buraksezer:release/v0.5.0 Jan 11, 2023
@buraksezer
Copy link
Owner

I have merged your PR @derekperkins, thank you for your contribution!

@derekperkins derekperkins deleted the invalidate-pipeline branch January 11, 2023 21:03
@derekperkins
Copy link
Contributor Author

Awesome, I'll roll that out today or tomorrow in prod and see how it runs! Hopefully this also resolves #198

@buraksezer
Copy link
Owner

I released Olric v0.5.1. Waiting for the results! https://github.com/buraksezer/olric/releases/tag/v0.5.1

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.

None yet

2 participants