Skip to content

Commit

Permalink
Set the new load management option to ignored.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBab committed Sep 9, 2023
1 parent b061af6 commit 3c33e77
Showing 1 changed file with 4 additions and 40 deletions.
44 changes: 4 additions & 40 deletions src/freenet/node/NodeStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ public void shouldUpdate(){
public final DecayingKeyspaceAverage avgClientCacheSSKSuccess;
public final DecayingKeyspaceAverage avgStoreSSKSuccess;

private volatile boolean enableNewLoadManagementRT;
private volatile boolean enableNewLoadManagementBulk;
private final boolean enableNewLoadManagementRT = false;
private final boolean enableNewLoadManagementBulk = false;

NodeStats(Node node, int sortOrder, SubConfig statsConfig, int obwLimit, int ibwLimit, int lastVersion) throws NodeInitException {
this.node = node;
Expand Down Expand Up @@ -509,44 +509,8 @@ public void onChange(NETWORK_THREAT_LEVEL oldLevel, NETWORK_THREAT_LEVEL newLeve

});

statsConfig.register("enableNewLoadManagementRT", false, sortOrder++, true, false, "Node.enableNewLoadManagementRT", "Node.enableNewLoadManagementRTLong", new BooleanCallback() {

@Override
public Boolean get() {
return enableNewLoadManagementRT;
}

@Override
public void set(Boolean val) throws InvalidConfigValueException,
NodeNeedRestartException {
enableNewLoadManagementRT = val;
}

});
enableNewLoadManagementRT = statsConfig.getBoolean("enableNewLoadManagementRT");
statsConfig.register("enableNewLoadManagementBulk", false, sortOrder++, true, false, "Node.enableNewLoadManagementBulk", "Node.enableNewLoadManagementBulkLong", new BooleanCallback() {

@Override
public Boolean get() {
return enableNewLoadManagementBulk;
}

@Override
public void set(Boolean val) throws InvalidConfigValueException,
NodeNeedRestartException {
enableNewLoadManagementBulk = val;
}

});
enableNewLoadManagementBulk = statsConfig.getBoolean("enableNewLoadManagementBulk");

if(node.lastVersion <= 1455 && (enableNewLoadManagementRT || enableNewLoadManagementBulk)) {
// FIXME remove
enableNewLoadManagementRT = false;
enableNewLoadManagementBulk = false;
System.err.println("Turning off NLM when upgrading from pre-1455. The load stats messages aren't being sent at the moment so it won't work anyway.");
statsConfig.config.store();
}
statsConfig.registerIgnoredOption("enableNewLoadManagementRT");
statsConfig.registerIgnoredOption("enableNewLoadManagementBulk");

persister = new ConfigurablePersister(this, statsConfig, "nodeThrottleFile", "node-throttle.dat", sortOrder++, true, false,
"NodeStat.statsPersister", "NodeStat.statsPersisterLong", node.ticker, node.getRunDir());
Expand Down

0 comments on commit 3c33e77

Please sign in to comment.