@@ -39,6 +39,7 @@ export interface MarathonMatchScorerTaskLaunchResult {
3939
4040export interface MarathonMatchScorerTaskLaunchOptions {
4141 memberId ?: string ;
42+ stopSupersededMemberTasks ?: boolean ;
4243}
4344
4445interface ActiveScorerTask {
@@ -89,7 +90,7 @@ export class EcsService {
8990 * @param mmConfig Task definition name and version from the marathonMatchConfig record.
9091 * @param scoringPhase Active phase settings used by the runner for flags and seed range.
9192 * @param reviewId Optional review-api review id that should be marked completed after callback processing.
92- * @param launchOptions Optional submission owner metadata used for per-member in-flight task cancellation .
93+ * @param launchOptions Optional submission owner metadata and cancellation controls for in-flight member tasks .
9394 * @returns ECS task launch details with task/log mapping metadata.
9495 * Required env vars: ECS_CLUSTER, ECS_CONTAINER_NAME, ECS_SUBNETS, ECS_SECURITY_GROUPS,
9596 * AWS_REGION, MARATHON_MATCH_API_URL, REVIEW_TYPE_ID, and Auth0 M2M settings
@@ -117,6 +118,8 @@ export class EcsService {
117118 const taskDefinitionVersion = mmConfig . taskDefinitionVersion ?. trim ( ) ;
118119 const testPhase = this . mapConfigTypeToTestPhase ( scoringPhase . configType ) ;
119120 const memberId = launchOptions . memberId ?. trim ( ) ;
121+ const shouldStopSupersededMemberTasks =
122+ launchOptions . stopSupersededMemberTasks !== false ;
120123
121124 if ( ! taskDefinitionName ) {
122125 throw new Error ( 'Missing required task definition name in mmConfig.' ) ;
@@ -136,11 +139,13 @@ export class EcsService {
136139 containerName ,
137140 ) ;
138141 const launchableActiveTasks = activeTasks
139- ? await this . stopSupersededMemberScorerTasks ( cluster , activeTasks , {
140- challengeId,
141- submissionId,
142- memberId,
143- } )
142+ ? shouldStopSupersededMemberTasks
143+ ? await this . stopSupersededMemberScorerTasks ( cluster , activeTasks , {
144+ challengeId,
145+ submissionId,
146+ memberId,
147+ } )
148+ : activeTasks
144149 : null ;
145150 let maxConcurrentScorerTasks : number | null = null ;
146151
0 commit comments