[Swift-commit] cog r3546
swift at ci.uchicago.edu
swift at ci.uchicago.edu
Thu Jan 10 18:40:05 CST 2013
------------------------------------------------------------------------
r3546 | hategan | 2013-01-10 18:35:52 -0600 (Thu, 10 Jan 2013) | 1 line
added initial flag to distinguish between a valid request and a timed-out request sending spurious data
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/KarajanChannel.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/KarajanChannel.java (revision 3545)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/KarajanChannel.java (working copy)
@@ -26,6 +26,7 @@
public static final int ERROR_FLAG = 0x00000004;
public static final int COMPRESSED_FLAG = 0x00000008;
public static final int SIGNAL_FLAG = 0x00000010;
+ public static final int INITIAL_FLAG = 0x00000020;
void sendTaggedData(int i, boolean fin, byte[] bytes);
Index: modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/AbstractKarajanChannel.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/AbstractKarajanChannel.java (revision 3545)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/AbstractKarajanChannel.java (working copy)
@@ -479,9 +479,16 @@
return;
}
try {
- handler = getRequestManager().handleInitialRequest(tag, data);
- handler.setId(tag);
- registerHandler(handler, tag);
+ if (flagIsSet(flags, INITIAL_FLAG)) {
+ handler = getRequestManager().handleInitialRequest(tag, data);
+ handler.setId(tag);
+ registerHandler(handler, tag);
+ }
+ else {
+ if (logger.isInfoEnabled()) {
+ logger.info("Received spurious request data, tag: " + tag + ", len: " + len);
+ }
+ }
}
catch (NoSuchHandlerException e) {
if (!getChannelContext().isIgnoredRequest(tag)) {
Index: modules/karajan/src/org/globus/cog/karajan/workflow/service/commands/Command.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/service/commands/Command.java (revision 3545)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/service/commands/Command.java (working copy)
@@ -110,8 +110,7 @@
if (channel == null) {
throw new ProtocolException("Unregistered command");
}
- boolean fin = (outData == null) || (outData.size() == 0);
-
+
if (logger.isDebugEnabled()) {
logger.debug(ppOutData("CMD"));
}
@@ -123,7 +122,16 @@
if (id == NOID) {
logger.warn("Command has NOID: " + this, new Throwable());
}
- channel.sendTaggedData(id, fin, getOutCmd().getBytes(), fin ? this : null);
+ int flags;
+ boolean fin = (outData == null) || (outData.size() == 0);
+ if (fin) {
+ flags = KarajanChannel.FINAL_FLAG + KarajanChannel.INITIAL_FLAG;;
+ }
+ else {
+ flags = KarajanChannel.INITIAL_FLAG;;
+ }
+
+ channel.sendTaggedData(id, flags, getOutCmd().getBytes(), fin ? this : null);
if (!fin) {
Iterator<byte[]> i = outData.iterator();
while (i.hasNext()) {
More information about the Swift-commit
mailing list