|
From: <ha...@us...> - 2007-10-02 21:19:57
|
Revision: 1771
http://cogkit.svn.sourceforge.net/cogkit/?rev=1771&view=rev
Author: hategan
Date: 2007-10-02 14:19:53 -0700 (Tue, 02 Oct 2007)
Log Message:
-----------
only cleanup once
Modified Paths:
--------------
trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
Modified: trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java
===================================================================
--- trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java 2007-10-02 14:37:27 UTC (rev 1770)
+++ trunk/current/src/cog/modules/provider-gt2/src/org/globus/cog/abstraction/impl/execution/gt2/JobSubmissionTaskHandler.java 2007-10-02 21:19:53 UTC (rev 1771)
@@ -54,6 +54,7 @@
private GassServer gassServer = null;
private JobOutputStream stdoutStream;
private JobOutputStream stderrStream;
+ private boolean cleaned;
public void submit(Task task) throws IllegalSpecException,
InvalidSecurityContextException, InvalidServiceContactException,
@@ -280,7 +281,8 @@
boolean batchJob = spec.isBatchJob();
boolean redirected = spec.getStdOutputLocation().overlaps(
FileLocation.MEMORY_AND_LOCAL)
- || spec.getStdErrorLocation().overlaps(FileLocation.MEMORY_AND_LOCAL);
+ || spec.getStdErrorLocation().overlaps(
+ FileLocation.MEMORY_AND_LOCAL);
if (batchJob && redirected) {
throw new IllegalSpecException(
@@ -357,7 +359,8 @@
}
// if output is to be redirected
- if (FileLocation.MEMORY_AND_LOCAL.overlaps(spec.getStdOutputLocation())) {
+ if (FileLocation.MEMORY_AND_LOCAL.overlaps(spec
+ .getStdOutputLocation())) {
Value v;
// if no output file is specified, use the stdout
if (FileLocation.MEMORY.overlaps(spec.getStdOutputLocation())) {
@@ -376,7 +379,8 @@
.getStdOutput()));
}
// if error is to be redirected
- if (FileLocation.MEMORY_AND_LOCAL.overlaps(spec.getStdErrorLocation())) {
+ if (FileLocation.MEMORY_AND_LOCAL.overlaps(spec
+ .getStdErrorLocation())) {
Value v;
// if no error file is specified, use the stdout
if (FileLocation.MEMORY.overlaps(spec.getStdErrorLocation())) {
@@ -473,11 +477,14 @@
}
}
- private void cleanup() {
- this.gramJob.removeListener(this);
- CallbackHandlerManager.decreaseUsageCount(gramJob.getCredentials());
- if (gassServer != null) {
- GassServerFactory.decreaseUsageCount(gassServer);
+ private synchronized void cleanup() {
+ if (!cleaned) {
+ this.gramJob.removeListener(this);
+ CallbackHandlerManager.decreaseUsageCount(gramJob.getCredentials());
+ if (gassServer != null) {
+ GassServerFactory.decreaseUsageCount(gassServer);
+ }
+ cleaned = true;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|