[ARVADOS] updated: a4926dfa88f36c529096f30b223a434479cd0eb8

git at public.curoverse.com git at public.curoverse.com
Fri Jul 10 12:51:21 EDT 2015


Summary of changes:
 apps/workbench/public/webshell/shell_in_a_box.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

       via  a4926dfa88f36c529096f30b223a434479cd0eb8 (commit)
      from  6929750b2f8f1f0b01b40f0ac516ec5f9e431c4d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a4926dfa88f36c529096f30b223a434479cd0eb8
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Jul 10 12:45:54 2015 -0400

    6279: Do not retry a request that "timed out" in less than 2 seconds.
    
    In this case it's probably not a timeout -- more likely a CORS problem
    that the browser is not allowed to report to the Javascript program.
    In such cases, retrying ad infinitum will not help.

diff --git a/apps/workbench/public/webshell/shell_in_a_box.js b/apps/workbench/public/webshell/shell_in_a_box.js
index 6fdf10d..51a5792 100644
--- a/apps/workbench/public/webshell/shell_in_a_box.js
+++ b/apps/workbench/public/webshell/shell_in_a_box.js
@@ -185,6 +185,7 @@ ShellInABox.prototype.sendRequest = function(request) {
              }
            }
     }(this);
+  ShellInABox.lastRequestSent = Date.now();
   request.send(content);
 };
 
@@ -205,8 +206,13 @@ ShellInABox.prototype.onReadyStateChange = function(request) {
         this.sendRequest(request);
       }
     } else if (request.status == 0) {
-      // Time Out
-      this.sendRequest(request);
+        if (ShellInABox.lastRequestSent + 2000 < Date.now()) {
+            // Timeout, try again
+            this.sendRequest(request);
+        } else {
+            this.vt100('\r\n\r\nRequest failed.');
+            this.sessionClosed();
+        }
     } else {
       this.sessionClosed();
     }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list