@@ -181,7 +181,7 @@ private void checkDeploy(final SingularityPendingDeploy pendingDeploy, final Lis
181
181
}
182
182
183
183
SingularityDeployResult deployResult =
184
- getDeployResult (request , requestWithState .getState (), cancelRequest , pendingDeploy , updatePendingDeployRequest , deploy , deployMatchingTasks , allOtherMatchingTasks , inactiveDeployMatchingTasks );
184
+ getDeployResultSafe (request , requestWithState .getState (), cancelRequest , pendingDeploy , updatePendingDeployRequest , deploy , deployMatchingTasks , allOtherMatchingTasks , inactiveDeployMatchingTasks );
185
185
186
186
LOG .info ("Deploy {} had result {} after {}" , pendingDeployMarker , deployResult , JavaUtils .durationFromMillis (System .currentTimeMillis () - pendingDeployMarker .getTimestamp ()));
187
187
@@ -632,6 +632,17 @@ private LoadBalancerRequestId getLoadBalancerRequestId(SingularityPendingDeploy
632
632
LoadBalancerRequestType .DEPLOY , Optional .<Integer >empty ());
633
633
}
634
634
635
+ private SingularityDeployResult getDeployResultSafe (final SingularityRequest request , final RequestState requestState , final Optional <SingularityDeployMarker > cancelRequest , final SingularityPendingDeploy pendingDeploy ,
636
+ final Optional <SingularityUpdatePendingDeployRequest > updatePendingDeployRequest , final Optional <SingularityDeploy > deploy , final Collection <SingularityTaskId > deployActiveTasks , final Collection <SingularityTaskId > otherActiveTasks ,
637
+ final Collection <SingularityTaskId > inactiveDeployMatchingTasks ) {
638
+ try {
639
+ return getDeployResult (request , requestState , cancelRequest , pendingDeploy , updatePendingDeployRequest , deploy , deployActiveTasks , otherActiveTasks , inactiveDeployMatchingTasks );
640
+ } catch (Exception e ) {
641
+ LOG .error ("Uncaught exception processing deploy {} - {}" , pendingDeploy .getDeployMarker ().getRequestId (), pendingDeploy .getDeployMarker ().getDeployId (), e );
642
+ return new SingularityDeployResult (DeployState .FAILED_INTERNAL_STATE , String .format ("Uncaught exception: %s" , e .getMessage ()));
643
+ }
644
+ }
645
+
635
646
private SingularityDeployResult getDeployResult (final SingularityRequest request , final RequestState requestState , final Optional <SingularityDeployMarker > cancelRequest , final SingularityPendingDeploy pendingDeploy ,
636
647
final Optional <SingularityUpdatePendingDeployRequest > updatePendingDeployRequest , final Optional <SingularityDeploy > deploy , final Collection <SingularityTaskId > deployActiveTasks , final Collection <SingularityTaskId > otherActiveTasks ,
637
648
final Collection <SingularityTaskId > inactiveDeployMatchingTasks ) {
0 commit comments