Skip to content

Conversation

@snir911
Copy link
Contributor

@snir911 snir911 commented Oct 5, 2025

This allows different runtime handlers to have different container creation timeouts,
useful for VM-based runtimes that may need longer timeouts than OCI runtimes.

What type of PR is this?

/kind feature

What this PR does / why we need it:

Fixes #9151 and additional minor fixes

Which issue(s) this PR fixes:

Fixes #9151

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Added `container_create_timeout` option to control timeout duration of container creation

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 5, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 5, 2025

Hi @snir911. Thanks for your PR.

I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 5, 2025
@codecov
Copy link

codecov bot commented Oct 5, 2025

Codecov Report

❌ Patch coverage is 46.34146% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.90%. Comparing base (14e7ced) to head (3dd90b8).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9499      +/-   ##
==========================================
+ Coverage   63.85%   63.90%   +0.04%     
==========================================
  Files         205      205              
  Lines       28699    28722      +23     
==========================================
+ Hits        18327    18355      +28     
+ Misses       8746     8743       -3     
+ Partials     1626     1624       -2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@snir911 snir911 force-pushed the 9151 branch 2 times, most recently from f74dbd0 to a0408f0 Compare October 9, 2025 09:13
@snir911 snir911 marked this pull request as ready for review October 9, 2025 10:33
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 9, 2025
@openshift-ci openshift-ci bot requested review from QiWang19 and hasan4791 October 9, 2025 10:33
@fidencio
Copy link
Contributor

fidencio commented Oct 9, 2025

@snir911, what happens when the ContainerCreateTimeout is set to, let's say, 600 (10 minutes), but kubelet's runtimeRequestTimeout is lower than that?

What I think that would happen is that kubelet's runtimeRequestTimeout would be the value respected in this case, which makes me think it's at least worth it adding to the documentation that the value set here depends also on the kubelet's value.

@snir911
Copy link
Contributor Author

snir911 commented Oct 9, 2025

That's right, I'll mention it, thanks @fidencio !

Copy link
Contributor

@littlejawa littlejawa left a comment

Choose a reason for hiding this comment

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

Thanks @snir911 !

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 9, 2025
@bitoku
Copy link
Contributor

bitoku commented Oct 10, 2025

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 10, 2025
@bitoku
Copy link
Contributor

bitoku commented Oct 10, 2025

/release-note-edit

Added `container_create_timeout` option to control timeout duration of container creation

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 10, 2025

@bitoku: /release-note-edit must be used with a single release note block.

Details

In response to this:

/release-note-edit

Added `container_create_timeout` option to control timeout duration of container creation

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 10, 2025
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 15, 2025
@openshift-ci openshift-ci bot removed the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Nov 20, 2025
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 20, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 20, 2025
@snir911 snir911 force-pushed the 9151 branch 2 times, most recently from a732847 to 5097166 Compare November 23, 2025 14:17
@openshift-ci openshift-ci bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Nov 23, 2025
@snir911 snir911 force-pushed the 9151 branch 3 times, most recently from 37ad46f to abf1b0f Compare November 25, 2025 14:46
@snir911
Copy link
Contributor Author

snir911 commented Nov 25, 2025

@saschagrunert @bitoku recent changes includes:

  1. skipping the execution test for runtime_vm as i cannot intercept the create calls for the shim
  2. modify log text to be persistent
  3. rebase
    (current error seems unrelated )

Another look will be appreciated, thanks

@bitoku
Copy link
Contributor

bitoku commented Nov 26, 2025

@snir911

skipping the execution test for runtime_vm as i cannot intercept the create calls for the shim

I thought this is needed especially for runtime_vm. It doesn't make sense to disable the test for vm.
Is it just a test infra issue, or code?

@snir911
Copy link
Contributor Author

snir911 commented Nov 26, 2025

It doesn't make sense to disable the test for vm. Is it just a test infra issue, or code?

@bitoku You’re correct. However, at the moment I have no idea how to simulate the hanging CreateContainer call in this test infra. When containerd-shim-v2 is used, the CreateContainer call is performed over ttrpc, so I can’t intercept it with a simple wrapper like we do in the runtime_oci case.

If it is possible, it will probably require a more complex test scenario, so it might make sense to implement it separately.

@bitoku
Copy link
Contributor

bitoku commented Nov 26, 2025

@snir911
Alright, can you add more explanation why we can't test it in the test code?
Then I'm good to merge this one.

This allows different runtime handlers to have different container creation timeouts,
useful for VM-based runtimes that may need longer timeouts than OCI runtimes.

Signed-off-by: Snir Schreiber <[email protected]>
Fixes: cri-o#9151
Previously, r.task.Create() used r.ctx (background context) which had no timeout,
this may cause the goroutine to continue running even after the select timeout was reached.

Signed-off-by: Snir Schreiber <[email protected]>
- Add container_create_timeout to crio.conf.5.md man page documentation
- Add container_create_timeout to configuration template in template.go

Signed-off-by: Snir Schreiber <[email protected]>
- Add ValidateContainerCreateTimeout unit tests covering:
  * Default timeout when not configured (240s)
  * Valid configured timeout values
  * Minimum timeout enforcement (30s)
  * Zero and negative value handling
  * Large timeout values
  * Different timeouts per runtime handler

Fixes: cri-o#9151
Signed-off-by: Snir Schreiber <[email protected]>
Add comprehensive BATS integration tests for the container_create_timeout
feature introduced in commit 63131b6. These tests verify:

- Default timeout value (240s) is applied when not configured
- Custom timeout values are properly set and respected
- Minimum timeout enforcement (30s minimum)
- Different runtime handlers can have different timeout values
- Verify the container create timeout is actually being triggered

Assisted-by: Claude AI
Signed-off-by: Snir Schreiber <[email protected]>
@snir911
Copy link
Contributor Author

snir911 commented Nov 27, 2025

Alright, can you add more explanation why we can't test it in the test code?
Then I'm good to merge this one.

@bitoku done, BTW how the two pending checks can be triggered?

@bitoku
Copy link
Contributor

bitoku commented Nov 27, 2025

They seem running. let me wait for the tests to be green.

@bitoku
Copy link
Contributor

bitoku commented Nov 27, 2025

/lgtm

@snir911 Thank you for your contribution and patience!

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2025
@snir911
Copy link
Contributor Author

snir911 commented Nov 27, 2025

/retest

1 similar comment
@snir911
Copy link
Contributor Author

snir911 commented Nov 27, 2025

/retest

@openshift-merge-bot openshift-merge-bot bot merged commit c0202e0 into cri-o:main Nov 27, 2025
68 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make ContainerCreateTimeout configurable

6 participants