-
Notifications
You must be signed in to change notification settings - Fork 1
configurable read timeout for image scanning #452
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
Conversation
Signed-off-by: Tomasz Janiszewski <[email protected]>
Signed-off-by: Tomasz Janiszewski <[email protected]>
Signed-off-by: Tomasz Janiszewski <[email protected]>
Will this change make it possible to overrride the default/globally configured timeout in one pipeline? |
I discussed with the team that sees this issue and they say that the analysis times out after 30 seconds. So, based on that, it seems it's not the read timeout (as it's 10 min currently) but rather connect or write timeout that needs to be configurable. |
Signed-off-by: Tomasz Janiszewski <[email protected]>
Signed-off-by: Tomasz Janiszewski <[email protected]>
Thank you, @andham! I agree. If the issue were a connect or write timeout, the root cause would likely be something other than slow scanning. A connect timeout typically happens when the server is unreachable or if a man-in-the-middle attack is interfering with the connection. Similarly, a write timeout would be suspicious because the request payload is small—just a JSON object with an image name and some options. On the other hand, the symptoms you described strongly suggest that large images are taking a long time to scan. Since the scanning process is blocking, the plugin must wait for a response, which is likely what's causing the read timeout while the image is being processed.
Jenkins plugin configuration is per job so there is no global configuration, each job has its own config so you can set higher timeout for a single job. |
But as the read timeout is already 10 minutes but the failure they see is a timeout after 30 seconds it indicates (in their case) that it's the connect or write connect. Based on your explaination it most likely is the connect timeout. |
This is what the error output looks like in Jenkins:
And it happens after 30 seconds with a large image. |
I just realized that the 10 minutes read timeout is something new. We're on v1.4.3 and in that release the read timeout is 30 seconds. |
My feedback on this PR would then be that a 600 sec (10 min) default for the read timeout sounds a bit long. Wouldn't it make more sense to have something like 60-120 sec as default, which should be enough in most cases? And if not there needs to be an explicit configured higher value. |
...iner-image-scanner/src/main/java/com/stackrox/jenkins/plugins/services/ApiClientFactory.java
Outdated
Show resolved
Hide resolved
...r-image-scanner/src/main/resources/com/stackrox/jenkins/plugins/StackroxBuilder/config.jelly
Outdated
Show resolved
Hide resolved
I just realized that the new property is not mentioned in the stackrox-container-image-scanner/README.md file. |
Fixes #414
Summary
Changes
Test Plan
This change allows users to configure appropriate timeout values for their environment, especially when scanning large Docker images
that may take longer than the previous 10-minute hardcoded limit.
🤖 Generated with https://claude.ai/code
Co-Authored-By: Claude [email protected]