internal/hcs cleanup; and callbackNumber type #2602
Open
helsaawy wants to merge 3 commits intomicrosoft:mainfrom
Open
internal/hcs cleanup; and callbackNumber type #2602helsaawy wants to merge 3 commits intomicrosoft:mainfrom
internal/hcs cleanup; and callbackNumber type #2602helsaawy wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Clarify docs. Fix spelling. Remove newline from comments. Don't serialize `OptionsWCOW.OutputHandlerCreator` to JSON. Consolidate redundant `internal/winapi/winapi.go` with `internal/winapi/doc.go`. Use `"internal/log".(*Hook)` to format logs and add span information in functional/gcs tests. Add testing `nil`-checks and logs to uVM/container/process testing operations. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Add `"internal/winapi".IsInvalidHandle` function to valid `Handle`s are neither `0` nor Invalid. Standardize system and process ID log/span field names. Use `"system-id"` for system ID rather than `"cid"`, which can be interpreted as "container ID". Add `(*Process).CloseCtx(context.Context)` and use that, along with `(*System).CloseCtx` where appropriate. Suppress lint issues (skipped error checks for `Close()` calls are ignored automatically, but not for `CloseCtx(ctx)`). Update CI lint version. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Add an explicit `callbackNumber` type and use an `atomic.Uintptr` to track callback numbers instead of the RWMutex `callbackMapLock`. Add comment clarifying use of `callbackNumber` as callback context. Add logs to `notificationWatcher` and `(*Process|*System)[un]registryCallback`. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Use dedicated callback number type and atomic counter
Add an explicit
callbackNumbertype and use anatomic.Uintptrto track callback numbers instead of the RWMutexcallbackMapLock.Add comment clarifying use of
callbackNumberas callback context.Add logs to
notificationWatcherand(*Process|*System).[un]registryCallback.Add
"internal/winapi".IsInvalidHandlefunction to validHandles are neither0nor Invalid.Add
(*Process).CloseCtx(context.Context)and use that, along with(*System).CloseCtxwhere appropriate.Minor code cleanup and doc fixes:
Close()calls are ignored automatically, but not forCloseCtx(ctx))."system-id"for system ID rather than"cid", which can be interpreted as "container ID".OptionsWCOW.OutputHandlerCreatorto JSON.internal/winapi/winapi.gowithinternal/winapi/doc.go."internal/log".(*Hook)to format logs and add span information in functional/gcs tests.nil-checks and logs to uVM/container/process testing operations.Required for #2526