You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shim parses the JSON result document and handles the error events
(via `processHcsResult`) returned directly by HCS calls
(e.g.,`vmcompute.HcsCreateComputeSystem`), but ignores the JSON (data)
payload for notifications (which are either received from a
`processAsyncHcsResult` in the appropriate system or process call in
`"internal.hcs"`, or via `waitForNotification` in `waitBackground`).
This leads to ambiguous failure errors (e.g., `"The data is invalid."`)
that require ETW traces to track down the appropriate HCS logs, even
though the error events already provide enough information to identify
the issue.
Add `processNotification()` to:
1. parse the `notificationData` JSON payload provided by HCS to the
`notificationWatcher` callback into the an `hcsResult` struct; and
2. validate that the JSON data matches the notification HResult.
Create a new error type (`resultError`) to mirror the original [HCS
ResultError][result-error] and consolidate the events alongside the
original error.
Also, since `ErrorEvent`s are always converted to strings in the
context of concatenating several of them together, add an
`(*ErrorEvent).writeTo(*string.Builder)` function to provide more
efficient error string generation for `(HCS|System|Process)Error`s.
Additionally, consolidate the joining and formatting of error events
for those error types.
[result-error]: https://learn.microsoft.com/en-us/virtualization/api/hcs/schemareference#ResultError
Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
//Data []EventData `json:"Data,omitempty"` // Omit this as HCS doesn't encode this well. It's more confusing to include. It is however logged in debug mode (see processHcsResult function)
0 commit comments