Commit a5a61f6f authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Temporary fix for issue #370; disable Jacks (viewer and the constraint

checker) when the number of nodes is greater then 100. There appears to
be a pathological problem in Jacks that causes it to consume 100% of
your CPU for 5 minutes or so before finishing. The was making it
impossible for David to do his 200+ node tests.

Addendum: while testing this just now, I noticed that the problem is
related to the cross product of nodes and links. 100 nodes and no links
is actually not that bad, but add a lan and watch out!
parent 6d956e8c
......@@ -1400,7 +1400,21 @@ $(function ()
function ShowProfileSelectionInline(selectedElement, root, selectionPane) {
console.info("ShowProfileSelectionInline: " +
$(selectedElement).attr('value'));
var xmlDoc = $.parseXML(selected_rspec);
var nodecount = $(xmlDoc).find("node").length;
if (nodecount > 100) {
$('#stepsContainer #inline_overlay').addClass("hidden");
$('#inline_jacks #edit_dialog #edit_container')
.addClass("hidden");
return;
}
else {
$('#stepsContainer #inline_overlay').removeClass("hidden");
$('#inline_jacks #edit_dialog #edit_container')
.removeClass("hidden");
}
editor = new JacksEditor(root, true, true,
selectionPane, true, !multisite);
editor.show(selected_rspec);
......@@ -1614,7 +1628,14 @@ $(function ()
var count = 0;
sites = {};
//console.info("CreateAggregateSelectors");
var nodecount = $(xmlDoc).find("node").length;
if (nodecount > 100) {
doconstraints = 0;
}
else {
doconstraints = 1;
}
//console.info("CreateAggregateSelectors: ", nodecount, doconstraints);
/*
* Find the sites. Might not be any if not a multisite topology
......@@ -1947,6 +1968,10 @@ $(function ()
if (!window.MAINSITE) {
return;
}
if (!doconstraints) {
CreateClusterStatus();
return;
}
//console.info("updateWhere");
if (jacks.input && constraints && selected_rspec)
......
......@@ -704,6 +704,15 @@ $(function () {
xmlthing.done(callback);
}
function countNodes()
{
console.info("countNodes");
var xmlDoc = $.parseXML(RSPEC);
var count = $(xmlDoc).find("node").length;
console.info(count);
return count;
}
function StartPP(args) {
uuid = args.uuid;
registered = args.registered;
......@@ -764,18 +773,40 @@ $(function () {
}
function ChangeJacksRoot(root, selectionPane) {
// console.log(RSPEC);
// console.info("ChangeJacksRoot: ", root, selectionPane);
if (RSPEC)
{
editor = new JacksEditor(root, true, true, selectionPane, true);
editor.show(RSPEC);
{
if (countNodes() > 100) {
$('#stepsContainer #inline_overlay').addClass("hidden");
$('#inline_jacks #edit_dialog #edit_container')
.addClass("hidden");
return;
}
else {
$('#stepsContainer #inline_overlay').removeClass("hidden");
$('#inline_jacks #edit_dialog #edit_container')
.removeClass("hidden");
}
editor = new JacksEditor(root, true, true, selectionPane, true);
editor.show(RSPEC);
}
}
function ShowEditor() {
// console.log(RSPEC);
// console.info("ShowEditor");
if (RSPEC)
{
editor.show(RSPEC);
if (countNodes() > 100) {
$('#stepsContainer #inline_overlay').addClass("hidden");
$('#inline_jacks #edit_dialog #edit_container')
.addClass("hidden");
return;
}
else {
$('#stepsContainer #inline_overlay').removeClass("hidden");
$('#inline_jacks #edit_dialog #edit_container')
.removeClass("hidden");
}
editor.show(RSPEC);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment