Forums » User questions »
File transfer and job submission client doesn't complete
Added by Krause Amy over 12 years ago
Hi,
I'm currently writing a job submission client which transfers some files when the job has completed. I notice that the program never completes when I run the following code:
NSDirectory sourceDir = NSFactory.createNSDirectory(session, url, Flags.RECURSIVE.getValue());
sourceDir.copy(localDir, Flags.RECURSIVE.getValue());
sourceDir.close();
The files are transferred correctly but there seems to be a background thread that doesn't die.
Any ideas? How can I kill the background threads that seem to be spawned by JSAGA?
Another example of a background thread running is when the job service doesn't exist (because the hostname is incorrect for example). Then job.run() throws an exception:
Failure unspecified at GSS-API level [Caused by: java.net.UnknownHostException: xyz]
That looks good - but the program never returns because there's another thread. Is there anything else (except the session) that can be closed?
I noticed that some of the JSAGA example clients have this line at the end
System.exit(0);
which of course kills all threads but I can't do that because I'm calling JSAGA from a library.
Any help would be appreciated. Thank you!
Amy
Replies (5)
RE: File transfer and job submission client doesn't complete
-
Added by Schwarz Lionel over 12 years ago
Hi Amy,
The "jsaga-cp" command line does not have any
System.exit(0)
and there is no remaining thread issue.
I would like to understand if this comes from the core or from a specific adaptor. Which data adaptor do you have this problem with?
Lionel
RE: File transfer and job submission client doesn't complete
-
Added by Krause Amy over 12 years ago
Hi Lionel,
Sorry my mistake, it's not in jsaga-cp but there's a
System.exit(0)
is in jsaga-job-run.
I'm using GridFTP (gsiftp) for file transfers from my local file system to a remote GridFTP server, and the Globus (gatekeeper) to submit jobs.
Is there an object that I need to close or shut down?
Amy
RE: File transfer and job submission client doesn't complete
-
Added by Schwarz Lionel over 12 years ago
Amy, do you have this remaining thread when you submit a job that do not need any data staging? Please answer directly at lionel.schwarz@in2p3.fr so that we sort this out offline.
Cheers
Lionel
RE: File transfer and job submission client doesn't complete
-
Added by Schwarz Lionel over 12 years ago
Hi Amy,
After investigation it seems there is a bug in the globus library leading to a locked thread when the GSS authentication fails (for example when the remote server is not reachable) at the JSAGA submit step.
Anyway, authentication and availability of the remote server should be done at the JSAGA connect step, I will fix this for future snapshots.
In the meantime, as a workaround you can force the adaptor to check availability of the server and validation of the credential by adding the following attribute to your URL:
gatekeeper://yourserver.domain:2119/jobmanager-fork?CheckAvailability=true
This should allow your program to terminate when the connect to server fails.
Lionel
RE: File transfer and job submission client doesn't complete
-
Added by Krause Amy over 12 years ago
Hi Lionel,
Thank you for tracking this down and thanks for providing a workaround!
Amy