airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emre Brookes (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AIRAVATA-1864) GFAC-core - fix to NPE when no DataMovementInterfaces defined
Date Fri, 30 Oct 2015 09:31:27 GMT
Emre Brookes created AIRAVATA-1864:
--------------------------------------

             Summary: GFAC-core - fix to NPE when no DataMovementInterfaces defined
                 Key: AIRAVATA-1864
                 URL: https://issues.apache.org/jira/browse/AIRAVATA-1864
             Project: Airavata
          Issue Type: Bug
          Components: GFac
    Affects Versions: 0.15 
         Environment: java gfac core 
            Reporter: Emre Brookes
             Fix For: 0.15 


In BetterGfacImpl.java,  job submission protocol is being checked as part of data movement
protocol setting.  I believe you want to check if the data movement protocol is null.  Also,
the .get(0) will throw an NPE if you don't check that the getHostPrioritizedDataMovementInterfaces()
has at least one element (in this case I'm checking for not null && not empty).
Likely, similar code should be applied to the previous .get(0) in the job submission protocol
previous to this block. 

Here's the patch as a simple diff -u
--- BetterGfacImpl.java~        2015-10-28 12:39:17.586646368 -0500
+++ BetterGfacImpl.java 2015-10-29 15:01:48.300713817 -0500
@@ -345,7 +345,7 @@

             // set gatewayUserPreferred data movement protocol and interface
jobExecutionContext.setPreferredDataMovementProtocol(gatewayResourcePreferences.getPreferredDataMovementProtocol());
-            if (gatewayResourcePreferences.getPreferredJobSubmissionProtocol() == null) {
+            if (gatewayResourcePreferences.getPreferredDataMovementProtocol() == null &&
jobExecutionContext.getHostPrioritizedDataMovementInterfaces() != null && !jobExecutionContext.getHostPrioritizedDataMovementInterfaces().isEmpty()
) {
jobExecutionContext.setPreferredDataMovementInterface(jobExecutionContext.getHostPrioritizedDataMovementInterfaces().get(0));
                 if (jobExecutionContext.getPreferredDataMovementInterface() != null){
jobExecutionContext.setPreferredDataMovementProtocol(jobExecutionContext.getPreferredDataMovementInterface().getDataMovementProtocol());





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message