Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [unreleased]
### Added
- [#7081](https://github.com/apache/trafficcontrol/issues/7081) *Traffic Router* Added better log messages for TR connection exceptions.
- [#7089](https://github.com/apache/trafficcontrol/issues/7089) *Traffic Router* Added the ability to specify HTTPS certificate attributes.
- [#7109](https://github.com/apache/trafficcontrol/pull/7109) *Traffic Router* Removed `dnssec.zone.diffing.enabled` and `dnssec.rrsig.cache.enabled` parameters.
- [#7075](https://github.com/apache/trafficcontrol/pull/7075) *Traffic Portal* Added the `lastUpdated` field to all delivery service forms.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.nio.channels.Channels;

import org.apache.logging.log4j.LogManager;
Expand Down Expand Up @@ -91,6 +93,7 @@ class TCPSocketHandler implements SocketHandler {
@Override
@SuppressWarnings("PMD.EmptyCatchBlock")
public void run() {
InetAddress client = null;
if (cancel) {
cleanup();
return;
Expand All @@ -101,7 +104,7 @@ public void run() {
DataOutputStream os = new DataOutputStream(socket.getOutputStream())
) {
socket.setSoTimeout(getReadTimeout());
final InetAddress client = socket.getInetAddress();
client = socket.getInetAddress();

final int length = is.readUnsignedShort();
final byte[] request = new byte[length];
Expand All @@ -112,6 +115,20 @@ public void run() {
os.write(response);
} catch (final WireParseException e) {
// This is already recorded in the access log
} catch (final SocketTimeoutException e) {
String hostAddress = "unknown";
if (client != null) {
hostAddress = client.getHostAddress();
}
LOGGER.error("The socket with the Client at: " +
hostAddress + " has timed out. Error: " + e.getMessage());
} catch (final EOFException e) {
Comment thread
srijeet0406 marked this conversation as resolved.
String hostAddress = "unavailable";
if (client != null) {
hostAddress = client.getHostAddress();
}
LOGGER.error("The client at " + hostAddress +
" has closed the connection prematurely. Error: " + e.getMessage());
} catch (final Exception e) {
LOGGER.error(e.getMessage(), e);
} finally {
Expand Down