Skip to content

Comments

Fix oak functions integration test thread leak#3919

Merged
jul-sh merged 6 commits intoproject-oak:mainfrom
jul-sh:fix-thread-leak
May 5, 2023
Merged

Fix oak functions integration test thread leak#3919
jul-sh merged 6 commits intoproject-oak:mainfrom
jul-sh:fix-thread-leak

Conversation

@jul-sh
Copy link

@jul-sh jul-sh commented Apr 28, 2023

Issue introduced in #3884, closes #3891.

@jul-sh jul-sh marked this pull request as ready for review April 28, 2023 18:43
Copy link
Collaborator

@conradgrobler conradgrobler left a comment

Choose a reason for hiding this comment

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

Thanks

@conradgrobler
Copy link
Collaborator

If this no longer output the nextest warnings about leaks, please also update the example logs in https://github.com/project-oak/oak/blob/main/docs/development.md with a new valid run.

let response = client.invoke(b"xxxyyyzzz").await.expect("failed to invoke");
assert_eq!(std::str::from_utf8(&response).unwrap(), "xxxyyyzzz");

background.kill();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we have this happen on Drop, instead of explicitly having to call it?

Copy link
Author

@jul-sh jul-sh May 2, 2023

Choose a reason for hiding this comment

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

I like the idea. Curiously the comment above function that returns this claims that this already happens (it doesn't).

We cannot implement this on the existing type Box<dyn Running> since it conflicts with the existing Drop implementation of Box. We could however accomplish this by returning a type of our own, similar to tokio::process::Command. Might be worth doing so, but it'd be a slightly larger of change to xtask.

Copy link
Author

Choose a reason for hiding this comment

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

Went with a small solution that adds an extra struct for background tasks that implements the dropping. Ideally I think all tasks within xtask should be killed on drop. However implementing that may not be possible. The current solution will do for now.

@jul-sh
Copy link
Author

jul-sh commented May 2, 2023

If this no longer output the nextest warnings about leaks, please also update the example logs in https://github.com/project-oak/oak/blob/main/docs/development.md with a new valid run.

done

@jul-sh jul-sh requested a review from tiziano88 May 2, 2023 22:21
@jul-sh jul-sh merged commit 1b5ddb6 into project-oak:main May 5, 2023
@jul-sh jul-sh deleted the fix-thread-leak branch May 5, 2023 19:38
@github-actions
Copy link

github-actions bot commented May 5, 2023

artifact_name = "oak_echo_enclave_app"
artifact_digest = "sha256:9bf80965a5e2b3d78b7d630f6b96dc88c7f7b2b2572f9415eabac1092b60a1f5"
provenance_digest = "sha256:b33c29328c574dbfc7dd90567782b6afb9869d1f17587c57dad47dfa65cb46eb"

@github-actions
Copy link

github-actions bot commented May 5, 2023

artifact_name = "oak_restricted_kernel_bin"
artifact_digest = "sha256:71636feea73fd8611f0c328b33bf34f53982575c8b3ba19c54fd2d25d5dc3c48"
provenance_digest = "sha256:bce7e892306637f5f468a8806731f3603e0cfaf9223c32dfcdfd013b9e26de3b"

@github-actions
Copy link

github-actions bot commented May 5, 2023

artifact_name = "oak_echo_raw_enclave_app"
artifact_digest = "sha256:375d13e351570c43c598ca80d1d1f514507f94d125bdc2bf8299b6825ad3c917"
provenance_digest = "sha256:30c06226fdc8e0dee96f25eec6f263d60a6f39f69cc8baf6416e37e0d424278f"

@github-actions
Copy link

github-actions bot commented May 5, 2023

artifact_name = "stage0"
artifact_digest = "sha256:9d74dfa1b3cfe2db610fb274c3f57866a0dccf0e536dedbf3edca434ba553072"
provenance_digest = "sha256:5a746c8fb852407dd6a41666a27ce36e76f4ce3d05eca0b6aafaafc3f63e0528"

@github-actions
Copy link

github-actions bot commented May 5, 2023

artifact_name = "oak_restricted_kernel_simple_io_bin"
artifact_digest = "sha256:4d9d362036bd92da6e7781cde022183182e3a37d88a68c9bf567bb3e9d277f21"
provenance_digest = "sha256:1a0c3ff768ff11bb141a3d01d2e6a0b007e865b975272ec16cd88d2a67657085"

@github-actions
Copy link

github-actions bot commented May 5, 2023

artifact_name = "oak_functions_enclave_app"
artifact_digest = "sha256:8a3de05be09a96756221de5f2397f0ce1abc383b707482b6244d432604800e95"
provenance_digest = "sha256:b5c89032fd21647a9243f6905148720e8f204f1e023649891f947fec58c8ca08"

@github-actions
Copy link

github-actions bot commented May 5, 2023

artifact_name = "quirk_echo_enclave_app"
artifact_digest = "sha256:62422d8bf5342a6ef4e8fd8e8b4bdea0bcfacd2ddd212f50e5ba7cc142677635"
provenance_digest = "sha256:2146396b84a0f1f78c28aa7be4f5a87d6ff45d7f85eafb38f0c3a8edb7e79211"

@github-actions
Copy link

github-actions bot commented May 5, 2023

artifact_name = "oak_tensorflow_enclave_app"
artifact_digest = "sha256:7a3159d21f4ff227a89660f454134b712ed1760b07a9cba376e599642ffc3365"
provenance_digest = "sha256:91d5e9da74a2f781de1a3ff63b1f2919729cd425311a160f90416ee9a8af1b43"

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.

Oak Functions tests leak threads

3 participants