Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/client-v1-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,7 @@ jobs:
private const int ERROR_NOT_FOUND = 1168;
private const int JobObjectBasicAccountingInformation = 1;
private const int JobObjectExtendedLimitInformation = 9;
private const int SCHED_E_TASK_NOT_RUNNING = unchecked((int)0x8004130b);
private const int SupervisorFailureExitCode = unchecked((int)0xe0434f4d);
private const int MaximumQuotaEntries = 500000;
private const int MinimumStableIsolationRounds = 3;
Expand Down Expand Up @@ -4096,6 +4097,10 @@ jobs:
InvokeComMethod(runningTask, "Stop");
}
}
catch (Exception error) when (IsTaskNotRunningException(error))
{
continue;
}
finally
{
ReleaseComObject(runningTask);
Expand All @@ -4116,6 +4121,19 @@ jobs:
}
}

private static bool IsTaskNotRunningException(Exception error)
{
while (error != null)
{
if (error.HResult == SCHED_E_TASK_NOT_RUNNING)
{
return true;
}
error = error.InnerException;
}
return false;
}

private static object InvokeComMethod(
object target,
string name,
Expand Down
4 changes: 2 additions & 2 deletions docs/phase1-conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ The later SDK validator repin must use these exact committed file bytes:

| File | Bytes | SHA-256 |
| --- | ---: | --- |
| `.github/workflows/client-v1-conformance.yml` | 442,868 | `6c3fcc8f0c9b34c918b241597cf97cc25a5e31fef991e1f915d71ea7a85b06cb` |
| `.github/workflows/client-v1-conformance.yml` | 443,639 | `d4e4029cf667026463b63eed2a2965f1e9f8c0c34b4b2d796afbbacfc00d2042` |
| `scripts/contract-canary.mjs` | 38,191 | `4eb4d9b693187f110343a4c1efd92e59a9705e25790845bf04b05cb5bac6cbb5` |
| `scripts/executable-resolution.mjs` | 7,575 | `c6f70a41e899ad3b7f21be2308e893c506a5a035ba5e95179086e1fcb72d9323` |
| `scripts/owned-temp-directory.mjs` | 6,965 | `a9c55c85cf2b7d70310d278bafd2c8e7695d66f4ae38b9c3f1f12fce0b442095` |
Expand All @@ -997,7 +997,7 @@ The later SDK validator repin must use these exact committed file bytes:
| `scripts/unix-producer-supervisor.test.sh` | 7,434 | `04b9fc8fb84ea4c535da78e2a0caf9ddd280a894f0094328269363f5e8590341` |
| `scripts/phase1-windows-supervisor-build.sh` | 4,646 | `713a9e0282887ade3e243b5ba175794d74cdb02c28c38dcd41491c9505812770` |
| `scripts/phase1-windows-supervisor-install.ps1` | 1,743 | `2baab275f0bb6789884cded5f6185d00bfa5348b9e7c3ad1e5575353639101d5` |
| `scripts/windows-job-supervisor.cs` | 279,634 | `83ad3e96d199f04eb83937fd431413baab04120fb2470883c7e67b2d0cd1c5d8` |
| `scripts/windows-job-supervisor.cs` | 280,235 | `12650946c6ecc0c5d5297c72d2a465465f3593e4d01b8f8a9c414f5190d8df0d` |
| `scripts/windows-job-supervisor.test.ps1` | 166,680 | `3e4c02f82d7f4528ab87105208cc3f3188f4736cdb97a094c2eb191b8d315731` |

The workflow embeds `windows-job-supervisor.cs` byte-for-byte. Before any local
Expand Down
14 changes: 7 additions & 7 deletions phase1-conformance.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
},
"harness": {
"repository": "OpenCoven/chat",
"revision": "971c80c6c5740a851185052efde01c81c28e5de4"
"revision": "b49cebc6e809cbe7cc9e517e66dacb14945e2ba3"
},
"harnessAuthority": {
"revision": "971c80c6c5740a851185052efde01c81c28e5de4",
"tree": "15d305e0b0c6063a13ebfcaacd55f41a2e450b3f",
"revision": "b49cebc6e809cbe7cc9e517e66dacb14945e2ba3",
"tree": "992364b6ca5dddb4b6c5254c55afb284789a2b5e",
"files": [
{
"path": "scripts/phase1-conformance.mjs",
Expand Down Expand Up @@ -116,8 +116,8 @@
},
{
"path": "scripts/windows-job-supervisor.cs",
"blob": "820496ab622f73471e9d4284d2d1a1992c9cd59e",
"sha256": "83ad3e96d199f04eb83937fd431413baab04120fb2470883c7e67b2d0cd1c5d8"
"blob": "c57719a08bf101ac5d22c5f1ad9ad043d89e200a",
"sha256": "12650946c6ecc0c5d5297c72d2a465465f3593e4d01b8f8a9c414f5190d8df0d"
},
{
"path": "scripts/contract-canary.mjs",
Expand Down Expand Up @@ -146,8 +146,8 @@
},
{
"path": ".github/workflows/client-v1-conformance.yml",
"blob": "863b182c00210efc04fd14e07e2ef16abcb8852a",
"sha256": "6c3fcc8f0c9b34c918b241597cf97cc25a5e31fef991e1f915d71ea7a85b06cb"
"blob": "af7f95349d9dd3fd3fd4c620c49799ffd376bc1b",
"sha256": "d4e4029cf667026463b63eed2a2965f1e9f8c0c34b4b2d796afbbacfc00d2042"
}
],
"productionDeltas": [
Expand Down
18 changes: 18 additions & 0 deletions scripts/windows-job-supervisor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,7 @@ public sealed class WindowsJobSupervisor : IDisposable
private const int ERROR_NOT_FOUND = 1168;
private const int JobObjectBasicAccountingInformation = 1;
private const int JobObjectExtendedLimitInformation = 9;
private const int SCHED_E_TASK_NOT_RUNNING = unchecked((int)0x8004130b);
private const int SupervisorFailureExitCode = unchecked((int)0xe0434f4d);
private const int MaximumQuotaEntries = 500000;
private const int MinimumStableIsolationRounds = 3;
Expand Down Expand Up @@ -3656,6 +3657,10 @@ private int StopMatchingRunningTasks(
InvokeComMethod(runningTask, "Stop");
}
}
catch (Exception error) when (IsTaskNotRunningException(error))
{
continue;
}
finally
{
ReleaseComObject(runningTask);
Expand All @@ -3676,6 +3681,19 @@ private int StopMatchingRunningTasks(
}
}

private static bool IsTaskNotRunningException(Exception error)
{
while (error != null)
{
if (error.HResult == SCHED_E_TASK_NOT_RUNNING)
{
return true;
}
error = error.InnerException;
}
return false;
}

private static object InvokeComMethod(
object target,
string name,
Expand Down
3 changes: 3 additions & 0 deletions src/client-v1-conformance-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,9 @@ describe('Chat-local protected Windows conformance workflow', () => {
expect(usersMembership).toContain('ERROR_MEMBER_IN_ALIAS');
expect(usersMembership).not.toContain('"S-1-5-32-544"');
expect(source).toMatch(/"GetRunningTasks",\s+TASK_ENUM_HIDDEN/u);
expect(source).toContain('private static bool IsTaskNotRunningException(Exception error)');
expect(source).toContain('catch (Exception error) when (IsTaskNotRunningException(error))');
expect(source).toContain('error.HResult == SCHED_E_TASK_NOT_RUNNING');
expect(source).toContain('Ephemeral local user cleanup failed during creation.');
for (const failure of [
'Restricted identity unexpectedly belongs to Administrators.',
Expand Down
4 changes: 2 additions & 2 deletions src/phase1-conformance-lock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const expectedEntries = {
},
harness: {
repository: 'OpenCoven/chat',
revision: '971c80c6c5740a851185052efde01c81c28e5de4',
revision: 'b49cebc6e809cbe7cc9e517e66dacb14945e2ba3',
},
harnessAuthority: committedHarnessAuthority,
chatAuthority: {
Expand Down Expand Up @@ -470,7 +470,7 @@ describe('Phase 1 conformance lock', () => {
});
expect(committedHarnessAuthority).toMatchObject({
revision: expectedEntries.harness.revision,
tree: '15d305e0b0c6063a13ebfcaacd55f41a2e450b3f',
tree: '992364b6ca5dddb4b6c5254c55afb284789a2b5e',
});
});

Expand Down
Loading