Permalink
Browse files

adds socket.setdefaulttimeout to store_pushlogs webservice call and a…

…dds a default branch selection to the UI
  • Loading branch information...
jeads committed Feb 12, 2013
1 parent 524d6fc commit 9eff42081911eaaad562e4c88cfdacff238a1b6d
View
@@ -12,6 +12,7 @@
import time
import json
import urllib
+import socket
import zlib
import MySQLdb
@@ -382,6 +383,13 @@ def store_pushlogs(
"""
+ ###
+ #This sets the socket timeout globally for all socket operations.
+ #Its default setting is None. In production, the /json-pushes
+ #web service call will occasionally hang on a TCP CLOSE_WAIT state.
+ ###
+ socket.setdefaulttimeout(120)
+
# fetch the list of known branches.
branch_list = self.get_branch_list(branch)
@@ -411,8 +419,13 @@ def store_pushlogs(
)
self.println("URL: {0}".format(url), 1)
# fetch the JSON content from the constructed URL.
- res = urllib.urlopen(url)
- json_data = res.read()
+
+ try:
+ res = urllib.urlopen(url)
+ json_data = res.read()
+
+ except socket.timeout:
+ continue
try:
pushlog_dict = json.loads(json_data)
@@ -184,6 +184,8 @@ var GraphControlsView = new Class({
this.appContainerSel = '#app_container';
+ this.defaultBranchOption = 'v1-train';
+
//series label ids
this.datasetLegendSel = '#su_legend';
this.datasetTestLegendSel = '#su_test_legend';
@@ -279,6 +281,11 @@ var GraphControlsView = new Class({
addBranch: function(branch){
var optionEl = $('<option></option>');
$(optionEl).attr('value', branch);
+
+ if(branch === this.defaultBranchOption){
+ $(optionEl).attr('selected', 'selected');
+ }
+
$(optionEl).text(branch);
$(this.branchSelectMenuSel).append(optionEl);
}

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -66,7 +66,7 @@
<div class="ui-widget ui-widget-header ui-corner-all app-graph-container">
<div id="app_perf_wait" class="app-spinner"></div>
<div id="app_perf_data_container" style="display:none;">
- <div style="position:absolute; left:-60px; top:10px;" class="su-vertical-text">Average Run Time (milliseconds)</div>
+ <div style="position:absolute; left:-68px; top:10px;" class="su-vertical-text">Average Run Time (milliseconds)</div>
<div id="app_perf_chart" style="width:905px; height:370px; margin-top:5px; margin-left:35px;"></div>
<div id="app_perf_detail_container" class="ui-widget ui-widget-header ui-corner-all app-detail-graph-container">
<div style="width:180px;" class="app-control-element app-control-small-element">Application:<span id="app_series_application" class="app-data"></span></div>

0 comments on commit 9eff420

Please sign in to comment.