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

Redo wait() API. #88

Merged
merged 1 commit into from
Apr 24, 2023
Merged

Redo wait() API. #88

merged 1 commit into from
Apr 24, 2023

Conversation

ipuustin
Copy link
Contributor

The idea is that the shim implementations would need to do less thread management.

Fixes: #67

@cpuguy83 would this approach make sense? It should maybe be part of a wider API change if it is needed.

@ipuustin ipuustin marked this pull request as ready for review March 13, 2023 13:09
Copy link
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

lgtm!

@Mossaka
Copy link
Member

Mossaka commented Mar 16, 2023

@cpuguy83 can you take a look?

@cpuguy83
Copy link
Member

Thanks for taking a look!

I'm not sure I understand how this changes the interfaces/call structure.
Instead of a tx we wrap a tx but still need to deal with it effectively the same way.
Maybe I overlooked something?

@ipuustin
Copy link
Contributor Author

I'm not sure I understand how this changes the interfaces/call structure. Instead of a tx we wrap a tx but still need to deal with it effectively the same way. Maybe I overlooked something?

Well, the idea is just that the shims don't need to understand how the thread management should be done, because that's handled by the wrapper -- I understood that was what the original issue was after. Can you elaborate a bit what kind of API you would like to see and I can take another shot at this. :-)

Wait { tx: sender }
}

pub fn wait_for_exit_code(&self, exit_code: Arc<ExitCode>) -> Result<(), Error> {
Copy link
Member

Choose a reason for hiding this comment

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

It's not clear that this function does not block.
Naming is hard and I can't think of a good one right now.
Maybe just a doc string would suffice.

fn wait(&self, waiter: &Wait) -> Result<(), Error>;
}

pub struct Wait {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add docs for all these public type/functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added docs and also tried to think of a better name for the function.

@cpuguy83
Copy link
Member

@ipuustin Ok yes I totally just brain farted on this yesterday.
Design looks great.

@danbugs
Copy link
Contributor

danbugs commented Mar 29, 2023

~might want to update the README.md's mention of wait:

fn wait(&self, send: Sender<(u32, DateTime<Utc>)>) -> Result<(), Error>;

@cpuguy83
Copy link
Member

Looks like this needs a rebase.

The idea is that the shim implementations would need to do less thread
management.

Signed-off-by: Ismo Puustinen <[email protected]>
@cpuguy83 cpuguy83 merged commit 74c08ce into containerd:main Apr 24, 2023
4 checks passed
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.

Instance.wait() call semantics are weird
4 participants