Skip to content

Commit

Permalink
Remove Logger.OSThread-based PID logging that was always disabled
Browse files Browse the repository at this point in the history
The PID logging is always disabled and there is no API for enabling it.
Remove the entire implementation and all the calls to its logPID method,
but keep the interface for plugin compatibility.
  • Loading branch information
bertm committed Dec 1, 2024
1 parent fcc6e92 commit 59f0b6c
Show file tree
Hide file tree
Showing 25 changed files with 34 additions and 197 deletions.
1 change: 0 additions & 1 deletion src/freenet/clients/fcp/FCPConnectionInputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ void start() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
realRun();
} catch (TooLongException e) {
Expand Down
1 change: 0 additions & 1 deletion src/freenet/clients/fcp/FCPConnectionOutputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ void start() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
realRun();
} catch (IOException e) {
Expand Down
1 change: 0 additions & 1 deletion src/freenet/clients/fcp/FCPServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public void maybeStart() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
while(true) {
try {
networkInterface.waitBound();
Expand Down
1 change: 0 additions & 1 deletion src/freenet/clients/http/SimpleToadletServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,6 @@ void start() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
if(logMINOR) Logger.minor(this, "Handling connection");
try {
ToadletContextImpl.handle(sock, SimpleToadletServer.this, pageMaker, getUserAlertManager(), bookmarkManager);
Expand Down
1 change: 0 additions & 1 deletion src/freenet/io/NetworkInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ public void close() throws IOException {
*/
@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
while (!closed) {
try {
Socket clientSocket = serverSocket.accept();
Expand Down
2 changes: 0 additions & 2 deletions src/freenet/node/CHKInsertHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public String toString() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
realRun();
} catch (Throwable t) {
Expand Down Expand Up @@ -573,7 +572,6 @@ public class DataReceiver implements PrioRunnable {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
if(logMINOR) Logger.minor(this, "Receiving data for "+CHKInsertHandler.this);
// Don't log whether the transfer succeeded or failed as the transfer was initiated by the source therefore could be unreliable evidence.
br.receive(new BlockReceiverCompletion() {
Expand Down
3 changes: 0 additions & 3 deletions src/freenet/node/CHKInsertSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ void start() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
this.realRun();
} catch (Throwable t) {
Expand Down Expand Up @@ -395,7 +394,6 @@ public String toString() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
origTag.startedSender();
try {
routeRequests();
Expand Down Expand Up @@ -917,7 +915,6 @@ public synchronized boolean sentRequest() {

private void waitForBackgroundTransferCompletions() {
try {
freenet.support.Logger.OSThread.logPID(this);
if(logMINOR) Logger.minor(this, "Waiting for background transfer completions: "+this);

// We must presently be at such a stage that no more background transfers will be added.
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/DNSRequester.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ void start() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
while(true) {
try {
realRun();
Expand Down
2 changes: 0 additions & 2 deletions src/freenet/node/IPDetectorPluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ private void tryMaybeRun() {
node.getTicker().queueTimedJob(new Runnable() {
@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
tryMaybeRun();
}
}, MINUTES.toMillis(1));
Expand Down Expand Up @@ -718,7 +717,6 @@ public void kill() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
realRun();
} catch (Throwable t) {
Expand Down
3 changes: 0 additions & 3 deletions src/freenet/node/LocationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ public class SwapRequestSender implements Runnable {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
Thread.currentThread().setName("SwapRequestSender");
while(true) {
try {
Expand Down Expand Up @@ -556,7 +555,6 @@ public class IncomingSwapRequestHandler implements Runnable {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
MessageDigest md = SHA256.getMessageDigest();

boolean reachedEnd = false;
Expand Down Expand Up @@ -716,7 +714,6 @@ public class OutgoingSwapRequestHandler implements Runnable {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
long uid = r.nextLong();
if(!lock()) return;
boolean reachedEnd = false;
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/LoggingConfigHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ void start() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
fileLoggerHook.waitForSwitch();
delete(logDir);
}
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -3438,7 +3438,6 @@ private void scheduleVersionTransition() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
for(PeerNode pn: peers.myPeers()) {
pn.updateVersionRoutablity();
}
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/PacketSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public void run() {
@Override
public void run() {
if(logMINOR) Logger.minor(this, "In PacketSender.run()");
freenet.support.Logger.OSThread.logPID(this);

schedulePeriodicJob();
/*
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/Persister.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ void interrupt() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
persistThrottle();
} catch (Throwable t) {
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/RequestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public RequestHandler(PeerNode source, long id, Node n, short htl, Key key, Requ

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
realRun();
//The last thing that realRun() does is register as a request-sender listener, so any exception here is the end.
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/RequestSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ public void run() {
static final int MAX_HIGH_HTL_FAILURES = 5;

private void realRun() {
freenet.support.Logger.OSThread.logPID(this);
if(isSSK && (pubKey == null)) {
pubKey = ((NodeSSK)key).getPubKey();
}
Expand Down
2 changes: 0 additions & 2 deletions src/freenet/node/RequestStarter.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ private boolean startRequest(ChosenBlock req, boolean logMINOR) {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
while(true) {
try {
realRun();
Expand All @@ -248,7 +247,6 @@ public SenderThread(ChosenBlock req, Key key) {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
// FIXME ? key is not known for inserts here
if (key != null)
stats.reportOutgoingLocalRequestLocation(key.toNormalizedDouble());
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/SSKInsertHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public String toString() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
realRun();
} catch (Throwable t) {
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/SSKInsertSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ void start() {

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
origTag.startedSender();
try {
routeRequests();
Expand Down
2 changes: 0 additions & 2 deletions src/freenet/node/TextModeClientInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public TextModeClientInterface(Node n, NodeClientCore core, HighLevelSimpleClien

@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
try {
realRun();
} catch (IOException e) {
Expand Down Expand Up @@ -426,7 +425,6 @@ private boolean processLine(BufferedReader reader) throws IOException {
n.getTicker().queueTimedJob(new Runnable() {
@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
n.getNodeUpdater().arm();
}
}, 0);
Expand Down
1 change: 0 additions & 1 deletion src/freenet/node/TextModeClientInterfaceServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ public void set(Integer val) throws InvalidConfigValueException {
*/
@Override
public void run() {
freenet.support.Logger.OSThread.logPID(this);
while(true) {
int curPort = port;
String tempBindTo = this.bindTo;
Expand Down
Loading

0 comments on commit 59f0b6c

Please sign in to comment.