diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d337fabb..895955f0b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,10 +8,11 @@ install_dependency: &install_dependency command: | sed -i '/jessie-updates/d' /etc/apt/sources.list apt update - apt install -y openssl ant git zip jq + apt install -y --force-yes openssl ant git zip jq mkdir ~/awscli cd ~/awscli - curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" + #curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" + curl https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.188.zip -o awscli-bundle.zip unzip awscli-bundle.zip ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws cd /usr/share/ant/lib @@ -24,7 +25,7 @@ install_dependency: &install_dependency install_deploysuite: &install_deploysuite name: Installation of install_deploysuite. command: | - git clone --branch v1.3 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript + git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript cp ./../buildscript/master_deploy.sh . cp ./../buildscript/buildenv.sh . cp ./../buildscript/awsconfiguration.sh . diff --git a/src/java/main/com/topcoder/direct/services/view/ajax/CustomFormatAJAXResult.java b/src/java/main/com/topcoder/direct/services/view/ajax/CustomFormatAJAXResult.java index 2cf7da282..35fbadda6 100644 --- a/src/java/main/com/topcoder/direct/services/view/ajax/CustomFormatAJAXResult.java +++ b/src/java/main/com/topcoder/direct/services/view/ajax/CustomFormatAJAXResult.java @@ -8,6 +8,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.SocketException; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; import java.util.zip.GZIPOutputStream; @@ -24,6 +25,7 @@ import com.topcoder.direct.services.view.action.contest.launch.AggregateDataModel; import com.topcoder.direct.services.view.ajax.processors.DefaultAJAXResultPreProcessor; import com.topcoder.direct.services.view.ajax.serializers.JSONDataSerializer; +import org.apache.log4j.Logger; /** *

@@ -81,6 +83,13 @@ *

* *

+ * Version 1.2 + *

+ *

+ * + *

* Thread safety: Technically this class is NOT thread safe since it has mutable states, but the intended * usage of the mutators is for IoC injection and thus we expect for these values not to be changed after * initialization. Thus this class can be considered as thread-safe conditional in an IoC injection usage of @@ -88,7 +97,7 @@ *

* * @author AleaActaEst, TCSDEVELOPER, duxiaoyang - * @version 1.1 + * @version 1.2 */ @SuppressWarnings("serial") public class CustomFormatAJAXResult implements Result { @@ -177,6 +186,8 @@ public class CustomFormatAJAXResult implements Result { */ private boolean enabledGzip = false; + private Logger logger = Logger.getLogger(CustomFormatAJAXResult.class); + /** *

* Default constructor. @@ -290,7 +301,7 @@ public void execute(ActionInvocation invocation) throws AJAXDataPreProcessingExc * @throws IOException * if any io error happens */ - private static void writeDataAndClose(InputStream in, OutputStream out) throws IOException { + private void writeDataAndClose(InputStream in, OutputStream out) throws IOException { try { // Write input stream to output stream byte[] buf = new byte[BUFFER_SIZE]; @@ -300,11 +311,14 @@ private static void writeDataAndClose(InputStream in, OutputStream out) throws I } // flush output stream out.flush(); + } catch (IOException e) { + // The client side has aborted or closed connection + logger.error("The client side has aborted or closed connection", e); } finally { // close the input stream closeStream(in); // close the output stream - out.close(); + closeStream(out); } }