Skip to content
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

Simplify task management #442

Draft
wants to merge 250 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
9e11bd6
Remove AutoPool support
BMurri Sep 27, 2023
33d2ba8
Prepare to remove full task batch queries
BMurri Sep 27, 2023
6c2febc
Fix issues in previous commit
BMurri Sep 27, 2023
cdb2a17
Reimplement queueing tasks to batch
BMurri Sep 28, 2023
02f9fa7
Reimplement canceling tasks in batch
BMurri Sep 28, 2023
49da037
cleanup
BMurri Sep 28, 2023
d995b26
Merge branch 'main' into bmurri/simplify-task-management
BMurri Sep 28, 2023
bf2edad
Implement finding completed tasks via batch
BMurri Sep 29, 2023
b2eaa9d
Wire in initial pool size
BMurri Sep 29, 2023
f3e676b
Address quota issues arising from batching queued tasks instead of
BMurri Sep 29, 2023
8fa7677
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 2, 2023
64dde81
Change delay to interval
BMurri Oct 2, 2023
03465ea
Stub in processing node events
BMurri Oct 2, 2023
81bc584
WIP: Start to restore required error handling
BMurri Oct 3, 2023
0c2026b
Minor cleanup
BMurri Oct 3, 2023
446cc70
Add systemic failure handling, some cleanup, fixed minor errors
BMurri Oct 4, 2023
e1ab063
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 4, 2023
8cfe810
Fix formatting, difference readabiltiy
BMurri Oct 4, 2023
594ab0f
Correct query format
BMurri Oct 4, 2023
3b896d4
Correct query properties
BMurri Oct 4, 2023
c0d1f6b
TEMP: Change logging for visibility
BMurri Oct 4, 2023
3b74390
Rename OrchestrateOnBatchSchedulerService to OrchestrateOnBatchSchedu…
BMurri Oct 4, 2023
486c770
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 4, 2023
945649f
Further isolate the issues
BMurri Oct 5, 2023
bd7cf7b
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 5, 2023
3456c4a
Additional logging
BMurri Oct 5, 2023
33fff3e
Use actual relatopnship between cloudtask and testasks ids
BMurri Oct 5, 2023
372ded6
Removed last vestiges of support for AutoPools
BMurri Oct 6, 2023
7a30924
Removed last vestiges of support for AutoPools
BMurri Oct 6, 2023
9ad1916
Formatting
BMurri Oct 6, 2023
4689af7
Add (untested) processing of event messages
BMurri Oct 7, 2023
21e6199
Cleanup
BMurri Oct 9, 2023
04a2cf6
Fix blob tags query
BMurri Oct 10, 2023
6b7f6f0
Address possible multithreaded issue
BMurri Oct 10, 2023
16b3172
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 10, 2023
ffcb2dd
Restore incorrectly removed file
BMurri Oct 11, 2023
e06be2e
Address deployer issues
BMurri Oct 11, 2023
960f5b0
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 11, 2023
6c8f450
Process all TaskComplete events, only once
BMurri Oct 13, 2023
72c7dbd
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 13, 2023
3775d24
Set tasks to Running and some bug fixes
BMurri Oct 13, 2023
c28f50e
Fix security on uploaded blobs
BMurri Oct 13, 2023
c8bf555
Ensure that certain critical processes stop the app when failing
BMurri Oct 13, 2023
33eb1d5
Run CoA test
BMurri Oct 13, 2023
b6c89b2
Address breaks in the deployer
BMurri Oct 14, 2023
c177fbe
Removed dead code and changed AzureProxy.ListBlobsAsync
BMurri Oct 16, 2023
0bc5d01
Address failure in CoA
BMurri Oct 17, 2023
a61daa9
Formatting
BMurri Oct 17, 2023
5b1c3b5
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 17, 2023
0cfd7e2
Update deployer update
BMurri Oct 17, 2023
d899b3e
Remove unusable pools
BMurri Oct 17, 2023
b4e6235
Log errors that are retried
BMurri Oct 17, 2023
314740c
Implement remainder of events
BMurri Oct 18, 2023
d2ccfb2
Swap boolean flags for explicit permissions: trial the first
BMurri Oct 19, 2023
343e7ca
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 19, 2023
7ccc299
address found issues
BMurri Oct 24, 2023
b572088
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 24, 2023
532e7f4
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 25, 2023
dc43436
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 26, 2023
6363a36
Replace returned type (TesTask TesTask, Task<bool> IsModifiedAsync)
BMurri Oct 26, 2023
ad6a77b
formatting
BMurri Oct 26, 2023
263ab63
Add output logs
BMurri Oct 26, 2023
dba4464
Address azure api failures
BMurri Oct 26, 2023
22f0a1d
Fix list in blobs
BMurri Oct 26, 2023
1e88661
Cleanup
BMurri Oct 27, 2023
ba71c1e
Continue debugging
BMurri Oct 27, 2023
60db169
Cleanup
BMurri Oct 27, 2023
520c0e0
Cleanup
BMurri Oct 27, 2023
505f71a
Formatting and renaming
BMurri Oct 27, 2023
f605f2e
more logging to find reason event metadata isn't populating task log
BMurri Oct 27, 2023
3a1382a
formatting
BMurri Oct 27, 2023
62de42e
Fix event bugs
BMurri Oct 27, 2023
ba91091
fix TesOutputFileLog
BMurri Oct 28, 2023
22b2d8c
Gather information to better detect tasks affected by node failures
BMurri Oct 28, 2023
8dcd99e
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 28, 2023
df5b437
YA attempt at output file log
BMurri Oct 28, 2023
bb846a3
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 30, 2023
d611383
Add URL to failure logs and code cleanup
BMurri Oct 30, 2023
d7ca8c4
formatting
BMurri Oct 30, 2023
1bcf3ec
code correction and cleanup
BMurri Oct 30, 2023
34ac766
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 31, 2023
341199b
Process.WaitForExitAsync does not kill the process when the cancellat…
BMurri Oct 31, 2023
f7260d8
Address null issues
BMurri Oct 31, 2023
d1d9c46
address NullReferenceException
BMurri Nov 1, 2023
ed83f01
address NullReferenceException again
BMurri Nov 1, 2023
28364dd
Fix two exceptions and some code cleanup
BMurri Nov 2, 2023
774a2e3
Retry logging and reduction of errors when pools are removed
BMurri Nov 3, 2023
e17a1c3
finalize featires, cleanup code
BMurri Nov 4, 2023
bb3a137
Address exceptions and determine cause of task deletion failures
BMurri Nov 7, 2023
3fb901e
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 7, 2023
c1c68f4
Yet another attempt to get the desired info
BMurri Nov 8, 2023
e2b897b
Property 'identity' on type 'Microsoft.Azure.Batch.Protocol.Entities.…
BMurri Nov 8, 2023
31a34e5
https://learn.microsoft.com/azure/batch/batch-efficient-list-queries#…
BMurri Nov 8, 2023
45290b8
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 9, 2023
3e1b66e
Fix GetInternalTesTaskBlobUrlWithoutSasToken()
BMurri Nov 9, 2023
92d1947
Resolve file upload logs in runner
BMurri Nov 9, 2023
6f44d99
Eventify compute node failure conditions
BMurri Nov 10, 2023
7b6c634
Move processing of output file log from server to node
BMurri Nov 10, 2023
feb8ccc
Log retries
BMurri Nov 10, 2023
60ba233
Address feedback
BMurri Nov 10, 2023
7e5934c
Merge branch 'main' into bmurri/log-retries
BMurri Nov 10, 2023
50a40b5
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 10, 2023
42ff99f
Refactor for clarity and address issues
BMurri Nov 11, 2023
654cc18
Address errors, reduce batch api calls
BMurri Nov 14, 2023
5347d49
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 14, 2023
b216da1
Merge branch 'main' into bmurri/log-retries
BMurri Nov 14, 2023
8293f37
Address feedback
BMurri Nov 14, 2023
95fc2d9
Remove retries specifically on reading http responses
BMurri Nov 14, 2023
2add673
Fix imports ordering
BMurri Nov 14, 2023
33494f3
Merge branch 'main' into bmurri/log-retries
BMurri Nov 15, 2023
bfef5fd
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 15, 2023
e89e854
Merge branch 'main' into bmurri/log-retries
BMurri Nov 15, 2023
18a70ed
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 15, 2023
efbe46a
Merge branch 'main' into bmurri/log-retries
BMurri Nov 15, 2023
3c16567
fix predicates
BMurri Nov 15, 2023
b548e3d
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 15, 2023
aecebaa
fix time math around deleting cloud tasks
BMurri Nov 16, 2023
9c6181a
fix more time math around deleting cloud tasks
BMurri Nov 16, 2023
6046b04
Remove exception thrown during normal process shutdown
BMurri Nov 16, 2023
7b2640e
some cleanup
BMurri Nov 16, 2023
49a4508
some more cleanup
BMurri Nov 17, 2023
12bfb3a
Missed changes from the merge from 'main'
BMurri Nov 17, 2023
5ccf88a
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 17, 2023
e4c1a1c
Merge branch 'main' into bmurri/log-retries
BMurri Nov 20, 2023
d859c2d
Stage compute node ids and parallelize portions of queued task handling
BMurri Nov 21, 2023
e27682f
formatting and minor refactor
BMurri Nov 21, 2023
3784799
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 23, 2023
48c19ac
Refactor based on feedback
BMurri Nov 23, 2023
48ef66a
formatting
BMurri Nov 23, 2023
579a7a5
Futureproof Polly v7 code generation (since v8 is a complete refactor)
BMurri Nov 23, 2023
3cdffdb
Merge branch 'main' into bmurri/log-retries
BMurri Nov 27, 2023
e0275c5
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 29, 2023
5eb5228
Merge branch 'main' into bmurri/log-retries
BMurri Nov 29, 2023
0d50839
Refactor builders
BMurri Nov 29, 2023
8b5b58d
Refactor TestServices
BMurri Nov 29, 2023
371be08
Refactor for testability and to ensure that retries are logged when p…
BMurri Nov 30, 2023
cd0b275
format and refactor for clarity
BMurri Dec 1, 2023
0d6b864
Merge branch 'main' into bmurri/log-retries
BMurri Dec 1, 2023
3f577eb
format and refactor for clarity
BMurri Dec 1, 2023
ddb428e
formatting
BMurri Dec 2, 2023
0ea998f
Merge branch 'main' into bmurri/log-retries
BMurri Dec 4, 2023
e45a48b
Merge branch 'main' into bmurri/simplify-task-management
BMurri Dec 5, 2023
ba3d679
Merge branch 'main' into bmurri/log-retries
BMurri Dec 5, 2023
0bc5cfe
Merge branch 'main' into bmurri/simplify-task-management
BMurri Dec 5, 2023
313bc2b
Merge branch 'main' into bmurri/log-retries
BMurri Dec 11, 2023
c2def55
Order process logs (err then out), in order
BMurri Dec 11, 2023
fb20bff
WIP temporary marker
BMurri Dec 11, 2023
ab98d80
Merge branch 'main' into bmurri/simplify-task-management
BMurri Dec 11, 2023
99f5e48
Unit test multiple new pool quota checks
BMurri Dec 12, 2023
56823f7
Merge branch 'main' into bmurri/log-retries
BMurri Dec 16, 2023
98e6291
formatting
BMurri Dec 16, 2023
cf7fa12
Split builders and implementers
BMurri Dec 18, 2023
cbeffbb
Improve code reuse
BMurri Dec 19, 2023
9eff300
fix unit tests
BMurri Dec 19, 2023
9a8cee8
Reduce noise in PR
BMurri Dec 19, 2023
42769ff
Add comments and reduce noise in PR
BMurri Dec 19, 2023
3840fef
fix unit tests
BMurri Dec 19, 2023
14fff0c
formatting for PR clarity
BMurri Dec 19, 2023
d9c7ee6
formatting for PR clarity
BMurri Dec 19, 2023
b3f3e6c
Fix code doc comments
BMurri Dec 19, 2023
a24a903
fix test
BMurri Dec 19, 2023
e79f787
Merge branch 'main' into bmurri/simplify-task-management
BMurri Dec 20, 2023
a251124
Merge remote-tracking branch 'origin/bmurri/log-retries' into bmurri/…
BMurri Dec 20, 2023
ea3cba3
Merge branch 'main' into bmurri/simplify-task-management
BMurri Dec 20, 2023
91a7220
Merge branch 'main' into bmurri/simplify-task-management
BMurri Dec 21, 2023
247cdd6
formatting
BMurri Dec 21, 2023
1d65f72
queued task pipeline (batch api call reductions)
BMurri Dec 23, 2023
6dd9f77
formatting
BMurri Dec 27, 2023
2a479fa
Merge branch 'main' into bmurri/simplify-task-management
BMurri Jan 22, 2024
f240174
Merge branch 'main' into bmurri/simplify-task-management
BMurri Jan 27, 2024
805d7cc
format
BMurri Jan 27, 2024
632f878
Merge branch 'main' into bmurri/simplify-task-management
BMurri Feb 3, 2024
045d19c
Merge branch 'main' into bmurri/simplify-task-management
BMurri Feb 3, 2024
4bcca0f
Merge branch 'main' into bmurri/simplify-task-management
BMurri Feb 9, 2024
c2a649c
Merge branch 'main' into bmurri/simplify-task-management
BMurri Feb 13, 2024
1aef303
Merge branch 'bmurri/simplify-task-management' of https://github.com/…
BMurri Feb 13, 2024
38b5fed
Merge branch 'main' into bmurri/simplify-task-management
BMurri Feb 13, 2024
6892f12
Merge branch 'main' into bmurri/simplify-task-management
BMurri Mar 4, 2024
8a0cc40
Merge branch 'main' into bmurri/simplify-task-management
BMurri Mar 7, 2024
2065644
formatting
BMurri Mar 8, 2024
7970ec1
Feedback and minor cleanup
BMurri Mar 12, 2024
55a6d0c
fix off-by-one error
BMurri Mar 14, 2024
cfe1f27
Merge branch 'main' into bmurri/simplify-task-management
BMurri Mar 14, 2024
03dc2cf
Merge branch 'main' into bmurri/simplify-task-management
BMurri Mar 23, 2024
de34a24
Merge branch 'main' into bmurri/simplify-task-management
BMurri Mar 28, 2024
b390f12
Merge branch 'main' into bmurri/simplify-task-management
BMurri Mar 28, 2024
6389af6
Merge branch 'main' into bmurri/simplify-task-management
BMurri Apr 4, 2024
0483806
Merge branch 'main' into bmurri/simplify-task-management
BMurri Apr 16, 2024
004e972
Merge branch 'main' into bmurri/simplify-task-management
BMurri Apr 17, 2024
5b680ee
update dependencies
BMurri Apr 17, 2024
5515cef
Merge branch 'main' into bmurri/simplify-task-management
BMurri Apr 22, 2024
4a80856
Merge branch 'main' into bmurri/simplify-task-management
BMurri Apr 24, 2024
b9b2c45
Merge branch 'main' into bmurri/simplify-task-management
BMurri Apr 24, 2024
9a7cd15
Merge branch 'main' into bmurri/simplify-task-management
BMurri Apr 25, 2024
8e15f6d
Weird test failure
BMurri Apr 25, 2024
b969fe3
Add task start event to the processed events
BMurri Apr 26, 2024
e8d692c
Fix System.ArgumentOutOfRangeException: Specified argument was out of…
BMurri Apr 26, 2024
990aaf5
Merge branch 'main' into bmurri/simplify-task-management
BMurri May 1, 2024
0fe063f
Merge branch 'main' into bmurri/simplify-task-management
BMurri May 3, 2024
70e4166
Merge branch 'main' into bmurri/simplify-task-management
BMurri May 8, 2024
5c5fc7d
Merge branch 'main' into bmurri/simplify-task-management
BMurri May 9, 2024
640dc10
Merge branch 'main' into bmurri/simplify-task-management
BMurri May 15, 2024
6a355f6
cleanup
BMurri May 15, 2024
ff15485
Reduce load on storage account
BMurri May 16, 2024
01faf62
Give enough time for TES to accept connections
BMurri May 17, 2024
37ed656
Merge branch 'main' into bmurri/simplify-task-management
BMurri May 20, 2024
37b30af
Merge branch 'main' into bmurri/simplify-task-management
BMurri May 21, 2024
ec76b3c
Address terminal condition where cancelled task was completed
BMurri May 30, 2024
c9f318c
Merge branch 'main' into bmurri/simplify-task-management
BMurri Jun 12, 2024
43cc61c
Merge branch 'main' into bmurri/simplify-task-management
BMurri Jun 18, 2024
d348d4a
Merge branch 'main' into bmurri/simplify-task-management
BMurri Jun 25, 2024
ce3d36d
Merge branch 'main' into bmurri/simplify-task-management (with unit t…
BMurri Jul 25, 2024
9feb6f1
Fix unit tests
BMurri Jul 25, 2024
ed02220
Merge branch 'main' into bmurri/simplify-task-management
BMurri Jul 25, 2024
212bb79
Merge branch 'main' into bmurri/simplify-task-management
BMurri Jul 25, 2024
5ff4961
Fix issues in MapLocalPathToSasUrlAsync
BMurri Jul 25, 2024
ad44333
Merge branch 'main' into bmurri/simplify-task-management
BMurri Aug 8, 2024
7bae5d9
Merge branch 'main' into bmurri/simplify-task-management
BMurri Aug 13, 2024
bf935ca
Rename EmumerableExtensions and make queued task bulk processing more…
BMurri Aug 16, 2024
f120ca0
Merge branch 'main' into bmurri/simplify-task-management
BMurri Sep 18, 2024
6aa0f8d
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 9, 2024
64b35c4
fix unit tests
BMurri Oct 9, 2024
7b161ba
fix batch task environment
BMurri Oct 9, 2024
6e5ad3a
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 9, 2024
98baf8a
minor refactoring of task initialization and pool verification and cr…
BMurri Oct 12, 2024
eb4c780
formatting
BMurri Oct 14, 2024
1a0d6ae
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 14, 2024
4409ca6
several fixes
BMurri Oct 15, 2024
3ecca37
fix DI
BMurri Oct 15, 2024
e35dc8c
startup fixes
BMurri Oct 15, 2024
95306fb
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 15, 2024
7119891
temp logging
BMurri Oct 15, 2024
007df4d
more temp logging
BMurri Oct 17, 2024
4005a23
Repository retry logging
BMurri Oct 17, 2024
244e0d8
Fix repository retry logging
BMurri Oct 17, 2024
8554d30
Add ability to utilize enumerable retry sleep providers
BMurri Oct 18, 2024
049c4cb
Add jitter by default
BMurri Oct 18, 2024
ca978bd
Consolidate restart handlers and exit services when startup fails
BMurri Oct 18, 2024
ce2ca28
formatting
BMurri Oct 18, 2024
d48a5fe
attempted fix
BMurri Oct 18, 2024
32dd178
Various fixes
BMurri Oct 21, 2024
112a556
fix tests
BMurri Oct 21, 2024
0a547cc
Merge branch 'main' into bmurri/simplify-task-management
BMurri Oct 31, 2024
ad64b22
fix repository concurrency detection
BMurri Oct 31, 2024
17a0cd1
Handle RepositoryCollisionException
BMurri Oct 31, 2024
a6d9420
Fix task event processing loop
BMurri Nov 1, 2024
d19d95e
Logging formatting and level updates
BMurri Nov 1, 2024
c309cb5
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 1, 2024
b9b496e
Cleanup
BMurri Nov 2, 2024
7f299eb
Merge branch 'main' into bmurri/simplify-task-management
BMurri Nov 8, 2024
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
6 changes: 6 additions & 0 deletions Microsoft.GA4GH.TES.sln
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tes.SDK", "src\Tes.SDK\Tes.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tes.SDK.Tests", "src\Tes.SDK.Tests\Tes.SDK.Tests.csproj", "{AE7ADB92-BEC6-4030-B62F-BDBB6AC53CB4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tes.Repository", "src\Tes.Repository\Tes.Repository.csproj", "{515A4905-0522-4C72-BC18-41BE6A3BE880}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tes.SDK.Examples", "src\Tes.SDK.Examples\Tes.SDK.Examples.csproj", "{08A30572-2C5A-4F61-AF77-36F624A6020B}"
EndProject
Global
Expand Down Expand Up @@ -117,6 +119,10 @@ Global
{AE7ADB92-BEC6-4030-B62F-BDBB6AC53CB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE7ADB92-BEC6-4030-B62F-BDBB6AC53CB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE7ADB92-BEC6-4030-B62F-BDBB6AC53CB4}.Release|Any CPU.Build.0 = Release|Any CPU
{515A4905-0522-4C72-BC18-41BE6A3BE880}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{515A4905-0522-4C72-BC18-41BE6A3BE880}.Debug|Any CPU.Build.0 = Debug|Any CPU
{515A4905-0522-4C72-BC18-41BE6A3BE880}.Release|Any CPU.ActiveCfg = Release|Any CPU
{515A4905-0522-4C72-BC18-41BE6A3BE880}.Release|Any CPU.Build.0 = Release|Any CPU
{08A30572-2C5A-4F61-AF77-36F624A6020B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08A30572-2C5A-4F61-AF77-36F624A6020B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08A30572-2C5A-4F61-AF77-36F624A6020B}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
1 change: 1 addition & 0 deletions src/CommonUtilities/CommonUtilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Polly" Version="8.4.2" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<!--Mitigate reported security issues-->
<PackageReference Include="System.Text.Json" Version="8.0.5" />
Expand Down
2 changes: 1 addition & 1 deletion src/CommonUtilities/Models/NodeTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class NodeTask
public string? OutputsMetricsFormat { get; set; }
public List<string>? TimestampMetricsFormats { get; set; }
public List<string>? BashScriptMetricsFormats { get; set; }
public string? MountParentDirectoryPath { get; set; }
public RuntimeOptions RuntimeOptions { get; set; } = null!;
}

Expand Down Expand Up @@ -80,6 +79,7 @@ public class RuntimeOptions
public AzureEnvironmentConfig? AzureEnvironmentConfig { get; set; }

public bool? SetContentMd5OnUpload { get; set; }
public string? MountParentDirectoryPath { get; set; }
}

public class StorageTargetLocation
Expand Down
4 changes: 2 additions & 2 deletions src/CommonUtilities/PagedInterfaceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public static IAsyncEnumerable<T> ExecuteWithRetryAsync<T>(this AsyncRetryHandle
private sealed class PollyAsyncEnumerable<T> : IAsyncEnumerable<T>
{
private readonly IAsyncEnumerable<T> _source;
private readonly RetryHandler.AsyncRetryHandlerPolicy _retryPolicy;
private readonly AsyncRetryHandlerPolicy _retryPolicy;
private readonly Polly.Context _ctx;

public PollyAsyncEnumerable(IAsyncEnumerable<T> source, RetryHandler.AsyncRetryHandlerPolicy retryPolicy, Polly.Context ctx)
public PollyAsyncEnumerable(IAsyncEnumerable<T> source, AsyncRetryHandlerPolicy retryPolicy, Polly.Context ctx)
{
ArgumentNullException.ThrowIfNull(source);
ArgumentNullException.ThrowIfNull(retryPolicy);
Expand Down
24 changes: 21 additions & 3 deletions src/CommonUtilities/RetryHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@
namespace CommonUtilities;

/// <summary>
/// Utility class that facilitates the retry policy implementations for HTTP clients.
/// Utility class that facilitates the retry policy implementations for HTTP clients.
/// </summary>
public static class RetryHandler
{
/// <summary>
/// Polly Context key for caller method name
/// </summary>
public const string CallerMemberNameKey = $"Tes.ApiClients.{nameof(RetryHandler)}.CallerMemberName";

/// <summary>
/// Polly Context key for backup skip increment setting
/// </summary>
public const string BackupSkipProvidedIncrementKey = $"Tes.ApiClients.{nameof(RetryHandler)}.BackupSkipProvidedIncrementCount";

/// Polly Context key combined sleep method and enumerable duration policies
/// </summary>
public const string CombineSleepDurationsKey = $"Tes.ApiClients.{nameof(RetryHandler)}.CombineSleepDurations";

#region RetryHandlerPolicies
/// <summary>
/// Non-generic synchronous retry policy
Expand Down Expand Up @@ -100,7 +105,6 @@ public AsyncRetryHandlerPolicy(IAsyncPolicy retryPolicy)
/// <remarks>For mocking</remarks>
public AsyncRetryHandlerPolicy() { }


/// <summary>
/// Executes a delegate with the configured async policy.
/// </summary>
Expand Down Expand Up @@ -156,6 +160,20 @@ public virtual Task<TResult> ExecuteWithRetryAsync<TResult>(Func<CancellationTok

return retryPolicy.ExecuteAsync((_, ct) => action(ct), PrepareContext(caller), cancellationToken);
}

/// <summary>
/// Executes the specified asynchronous action within the policy and returns the captured result.
/// </summary>
/// <param name="action">The action to perform.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
/// <param name="caller">Name of method originating the retriable operation.</param>
/// <returns>The captured result.</returns>
public virtual Task<PolicyResult> ExecuteAndCaptureAsync(Func<CancellationToken, Task> action, CancellationToken cancellationToken, [System.Runtime.CompilerServices.CallerMemberName] string? caller = default)
{
ArgumentNullException.ThrowIfNull(action);

return retryPolicy.ExecuteAndCaptureAsync((_, token) => action(token), PrepareContext(caller), cancellationToken);
}
}

/// <summary>
Expand Down Expand Up @@ -277,6 +295,6 @@ public virtual async Task<T> ExecuteWithRetryAndConversionAsync<T>(Func<Cancella

public static Context PrepareContext(string? caller) => new()
{
[CallerMemberNameKey] = caller
[CallerMemberNameKey] = caller ?? throw new ArgumentNullException(nameof(caller))
};
}
Loading
Loading