-
Notifications
You must be signed in to change notification settings - Fork 121
Fix Docker scan timeout cancellation not working #1729
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
Merged
+212
−39
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c30bb08
Fix Docker scan timeout cancellation not working
a75bdaa
Address PR review feedback
e9693ae
Use stream.Dispose() instead of ContinueWith per review feedback
d238a05
Merge branch 'main' into fix/docker-scan-timeout-cancellation
AMaini503 7f91c6b
Observe readTask after stream disposal to prevent unobserved task exc…
7975b13
Simplify task observation to empty continuation with OnlyOnFaulted
b32316d
Use finally block for container cleanup to prevent leaks
da90d02
Merge branch 'main' into fix/docker-scan-timeout-cancellation
AMaini503 abb85b2
Capture exception in ReadOutput step telemetry
e22bc42
Merge branch 'main' into fix/docker-scan-timeout-cancellation
AMaini503 2b8c31f
Fix XML doc comment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...Microsoft.ComponentDetection.Common/Telemetry/Records/DockerServiceStepTelemetryRecord.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| namespace Microsoft.ComponentDetection.Common.Telemetry.Records; | ||
|
|
||
| /// <summary> | ||
| /// Telemetry record for individual Docker service operations. | ||
| /// Each step emits its own record, allowing identification of hung operations | ||
| /// by observing which step's record is missing. | ||
| /// </summary> | ||
| internal class DockerServiceStepTelemetryRecord : BaseDetectionTelemetryRecord | ||
| { | ||
| public override string RecordName => "DockerServiceStep"; | ||
|
|
||
| /// <summary> | ||
| /// The step being performed (CreateContainer, AttachContainer, StartContainer, ReadOutput, RemoveContainer). | ||
| /// </summary> | ||
| public string? Step { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The container ID (for correlation across steps). | ||
| /// </summary> | ||
| public string? ContainerId { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The image being scanned. | ||
| /// </summary> | ||
| public string? Image { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The command passed to the container. | ||
| /// </summary> | ||
| public string? Command { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Whether this step was cancelled due to timeout. | ||
| /// </summary> | ||
| public bool WasCancelled { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Exception message if the step failed. | ||
| /// </summary> | ||
| public string? ExceptionMessage { get; set; } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.