@@ -20,8 +20,6 @@ public enum TaskDependencyAction<TaskDescription: TaskDescriptionProtocol> {
20
20
case cancelAndRescheduleDependency( TaskDescription )
21
21
}
22
22
23
- private let taskSchedulerSubsystem = " org.swift.sourcekit-lsp.task-scheduler "
24
-
25
23
public protocol TaskDescriptionProtocol : Identifiable , Sendable , CustomLogStringConvertible {
26
24
/// Execute the task.
27
25
///
@@ -259,11 +257,6 @@ fileprivate actor QueuedTask<TaskDescription: TaskDescriptionProtocol> {
259
257
/// a new task that depends on it. Otherwise a no-op.
260
258
nonisolated func elevatePriority( to targetPriority: TaskPriority ) {
261
259
if priority < targetPriority {
262
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
263
- logger. debug (
264
- " Elevating priority of \( self . description. forLogging) from \( self . priority. rawValue) to \( targetPriority. rawValue) "
265
- )
266
- }
267
260
Task ( priority: targetPriority) {
268
261
await self . resultTask. value
269
262
}
@@ -336,9 +329,6 @@ public actor TaskScheduler<TaskDescription: TaskDescriptionProtocol> {
336
329
_ taskDescription: TaskDescription ,
337
330
@_inheritActorContext executionStateChangedCallback: ( @Sendable ( TaskExecutionState) async -> Void ) ? = nil
338
331
) async -> Task < Void , Never > {
339
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
340
- logger. debug ( " Scheduling \( taskDescription. forLogging) " )
341
- }
342
332
let queuedTask = await QueuedTask (
343
333
priority: priority,
344
334
description: taskDescription,
@@ -397,17 +387,13 @@ public actor TaskScheduler<TaskDescription: TaskDescriptionProtocol> {
397
387
case . cancelAndRescheduleDependency( let taskDescription) :
398
388
guard let dependency = self . currentlyExecutingTasks. first ( where: { $0. description. id == taskDescription. id } )
399
389
else {
400
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
401
- logger. fault (
402
- " Cannot find task to wait for \( taskDescription. forLogging) in list of currently executing tasks "
403
- )
404
- }
390
+ logger. fault (
391
+ " Cannot find task to wait for \( taskDescription. forLogging) in list of currently executing tasks "
392
+ )
405
393
return nil
406
394
}
407
395
if !taskDescription. isIdempotent {
408
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
409
- logger. fault ( " Cannot reschedule task ' \( taskDescription. forLogging) ' since it is not idempotent " )
410
- }
396
+ logger. fault ( " Cannot reschedule task ' \( taskDescription. forLogging) ' since it is not idempotent " )
411
397
return dependency
412
398
}
413
399
if dependency. priority > task. priority {
@@ -418,11 +404,9 @@ public actor TaskScheduler<TaskDescription: TaskDescriptionProtocol> {
418
404
case . waitAndElevatePriorityOfDependency( let taskDescription) :
419
405
guard let dependency = self . currentlyExecutingTasks. first ( where: { $0. description. id == taskDescription. id } )
420
406
else {
421
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
422
- logger. fault (
423
- " Cannot find task to wait for ' \( taskDescription. forLogging) ' in list of currently executing tasks "
424
- )
425
- }
407
+ logger. fault (
408
+ " Cannot find task to wait for ' \( taskDescription. forLogging) ' in list of currently executing tasks "
409
+ )
426
410
return nil
427
411
}
428
412
return dependency
@@ -440,11 +424,9 @@ public actor TaskScheduler<TaskDescription: TaskDescriptionProtocol> {
440
424
switch taskDependency {
441
425
case . cancelAndRescheduleDependency( let taskDescription) :
442
426
guard let task = self . currentlyExecutingTasks. first ( where: { $0. description. id == taskDescription. id } ) else {
443
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
444
- logger. fault (
445
- " Cannot find task to reschedule \( taskDescription. forLogging) in list of currently executing tasks "
446
- )
447
- }
427
+ logger. fault (
428
+ " Cannot find task to reschedule \( taskDescription. forLogging) in list of currently executing tasks "
429
+ )
448
430
return nil
449
431
}
450
432
return task
@@ -455,9 +437,6 @@ public actor TaskScheduler<TaskDescription: TaskDescriptionProtocol> {
455
437
if !rescheduleTasks. isEmpty {
456
438
Task . detached ( priority: task. priority) {
457
439
for task in rescheduleTasks {
458
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
459
- logger. debug ( " Suspending \( task. description. forLogging) " )
460
- }
461
440
await task. cancelToBeRescheduled ( )
462
441
}
463
442
}
@@ -468,25 +447,12 @@ public actor TaskScheduler<TaskDescription: TaskDescriptionProtocol> {
468
447
return
469
448
}
470
449
471
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
472
- logger. debug ( " Executing \( task. description. forLogging) with priority \( task. priority. rawValue) " )
473
- }
474
450
currentlyExecutingTasks. append ( task)
475
451
pendingTasks. removeAll ( where: { $0 === task } )
476
452
Task . detached ( priority: task. priority) {
477
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
478
- logger. debug (
479
- " Execution of \( task. description. forLogging) started with priority \( Task . currentPriority. rawValue) "
480
- )
481
- }
482
453
// Await the task's return in a task so that this poker can continue checking if there are more execution
483
454
// slots that can be filled with queued tasks.
484
455
let finishStatus = await task. execute ( )
485
- withLoggingSubsystemAndScope ( subsystem: taskSchedulerSubsystem, scope: nil ) {
486
- logger. debug (
487
- " Execution of \( task. description. forLogging) finished with priority \( Task . currentPriority. rawValue) "
488
- )
489
- }
490
456
await self . finalizeTaskExecution ( task: task, finishStatus: finishStatus)
491
457
}
492
458
}
0 commit comments