Skip to content

rpc/log: return first error always #2661

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

Open
wants to merge 1 commit into
base: criu-dev
Choose a base branch
from

Conversation

ivpravdin
Copy link
Contributor

Introduce interface to criu-log component to allocate
first error buffer shared between a parent and its children.

Use shared first error buffer to return correct
first error in rpc.

Fixes: #338

criu/log.c Outdated
@@ -123,6 +127,23 @@ int log_keep_err(void)
return 0;
}

int log_keep_shr_err(void)
Copy link
Member

Choose a reason for hiding this comment

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

log_keep_err does the same thing, doesn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new function creates new memory mapping with MAP_SHARED, this memory region is shared between a parent and its children. It's useful when a rpc server spawns a child but does not have access to the child's error buffer when something goes wrong

Copy link
Member

Choose a reason for hiding this comment

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

log_keep_err uses shmalloc, it creates shared regions too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uh, I was looking at the wrong shmalloc definition. I've updated it to just use log_keep_err.

Use shared first error buffer to return correct
first error in rpc.

Fixes: checkpoint-restore#338

Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
@ivpravdin ivpravdin force-pushed the return-first-err-rpc branch from 588c3b6 to d105f01 Compare May 8, 2025 00:44
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.

Report first error from RPC always!
2 participants