1
1
package cromwell .backend .async
2
2
3
- import akka .actor .{Actor , ActorRef }
3
+ import java .util .concurrent .ExecutionException
4
+
5
+ import akka .actor .{Actor , ActorLogging , ActorRef }
6
+ import cromwell .backend .{BackendJobDescriptor , SlowJobWarning }
4
7
import cromwell .backend .BackendJobExecutionActor ._
5
8
import cromwell .backend .async .AsyncBackendJobExecutionActor ._
6
- import cromwell .backend .{BackendJobDescriptor , SlowJobWarning }
7
9
import cromwell .core .CromwellFatalExceptionMarker
8
- import cromwell .core .logging .JobLogging
9
10
import cromwell .core .retry .{Retry , SimpleExponentialBackoff }
10
11
import cromwell .services .metadata .MetadataService .MetadataServiceResponse
11
12
12
- import java .util .concurrent .ExecutionException
13
13
import scala .concurrent .duration ._
14
14
import scala .concurrent .{ExecutionContext , Future , Promise }
15
15
import scala .util .{Failure , Success }
@@ -41,7 +41,7 @@ object AsyncBackendJobExecutionActor {
41
41
}
42
42
}
43
43
44
- trait AsyncBackendJobExecutionActor { this : Actor with JobLogging with SlowJobWarning =>
44
+ trait AsyncBackendJobExecutionActor { this : Actor with ActorLogging with SlowJobWarning =>
45
45
46
46
def dockerImageUsed : Option [String ]
47
47
@@ -84,20 +84,14 @@ trait AsyncBackendJobExecutionActor { this: Actor with JobLogging with SlowJobWa
84
84
85
85
override def receive : Receive = slowJobWarningReceive orElse {
86
86
case mode : ExecutionMode => robustExecuteOrRecover(mode)
87
- case IssuePollRequest (handle) =>
88
- jobLogger.info(" AN-522 Received IssuePollRequest" )
89
- robustPoll(handle)
90
- case PollResponseReceived (handle) if handle.isDone =>
91
- jobLogger.info(" AN-522 Received PollResponseReceived with isDone=true" )
92
- self ! Finish (handle)
87
+ case IssuePollRequest (handle) => robustPoll(handle)
88
+ case PollResponseReceived (handle) if handle.isDone => self ! Finish (handle)
93
89
case PollResponseReceived (handle) =>
94
90
// This should stash the Cancellable someplace so it can be cancelled once polling is complete.
95
91
// -Ywarn-value-discard
96
- jobLogger.info(" AN-522 Received PollResponseReceived with isDone=false" )
97
92
context.system.scheduler.scheduleOnce(pollBackOff.backoffMillis.millis, self, IssuePollRequest (handle))
98
93
()
99
94
case Finish (SuccessfulExecutionHandle (outputs, returnCode, jobDetritusFiles, executionEvents, _)) =>
100
- jobLogger.info(" AN-522 Received Finish with SuccessfulExecutionHandle" )
101
95
completionPromise.success(
102
96
JobSucceededResponse (jobDescriptor.key,
103
97
Some (returnCode),
@@ -110,23 +104,16 @@ trait AsyncBackendJobExecutionActor { this: Actor with JobLogging with SlowJobWa
110
104
)
111
105
context.stop(self)
112
106
case Finish (FailedNonRetryableExecutionHandle (throwable, returnCode, _)) =>
113
- jobLogger.info(" AN-522 Received Finish with FailedNonRetryableExecutionHandle" )
114
107
completionPromise.success(JobFailedNonRetryableResponse (jobDescriptor.key, throwable, returnCode))
115
108
context.stop(self)
116
109
case Finish (FailedRetryableExecutionHandle (throwable, returnCode, _)) =>
117
- jobLogger.info(" AN-522 Received Finish with FailedRetryableExecutionHandle" )
118
110
completionPromise.success(JobFailedRetryableResponse (jobDescriptor.key, throwable, returnCode))
119
111
context.stop(self)
120
112
case Finish (cromwell.backend.async.AbortedExecutionHandle ) =>
121
- jobLogger.info(" AN-522 Received Finish with AbortedExecutionHandle" )
122
113
completionPromise.success(JobAbortedResponse (jobDescriptor.key))
123
114
context.stop(self)
124
- case FailAndStop (t) =>
125
- jobLogger.info(" AN-522 Received FailAndStop" )
126
- failAndStop(t)
127
- case response : MetadataServiceResponse =>
128
- jobLogger.info(" AN-522 Received MetadataServiceResponse" )
129
- handleMetadataServiceResponse(sender(), response)
115
+ case FailAndStop (t) => failAndStop(t)
116
+ case response : MetadataServiceResponse => handleMetadataServiceResponse(sender(), response)
130
117
case badMessage => log.error(s " Unexpected message $badMessage. " )
131
118
}
132
119
0 commit comments