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

draft: fix execution lock in session #853

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jordanrfrazier
Copy link
Collaborator

Still issues around sending the future across threads, I think. Also had to use the tokio::sync::Mutex in order to hold the lock across the await, but I'm not sure that this is the correct pattern we should follow, as it may still result in a deadlock if we never receive a new batch from next.

@cla-bot cla-bot bot added the cla-signed Set when all authors of a PR have signed our CLA label Nov 8, 2023
@@ -13,15 +13,15 @@ use crate::error::{ErrorContext, IntoError, Result};
#[pyclass]
#[derive(Clone)]
pub(crate) struct Execution {
execution: Arc<Mutex<Option<RustExecution>>>,
execution: Arc<Option<RustExecution>>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given the difficulties, it seems like we may be better off having submitting an execution return a pair of Execution, StopChannel. Then we can leave the mutex in the execution code, but interact with the stop channel without locking it. Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I guess so 😞 . I'll try that route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Set when all authors of a PR have signed our CLA sparrow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants