Skip to content

Commit 6689cdc

Browse files
committed
merge in main
2 parents 64bfa6f + 476cccb commit 6689cdc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,4 @@
200200
</build>
201201
</profile>
202202
</profiles>
203-
</project>
203+
</project>

src/main/java/io/fusionauth/http/server/internal/HTTPWorker.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,14 @@ public void run() {
256256
logger.debug("[{}] Closing socket with status [{}]. Bad request, failed to parse request. Reason [{}] Parser state [{}]", Thread.currentThread().threadId(), Status.BadRequest, e.getMessage(), e.getState());
257257
closeSocketOnError(response, Status.BadRequest);
258258
} catch (SocketException e) {
259-
// This should only happen when the server is shutdown and this thread is waiting to read or write. In that case, this will throw a
260-
// SocketException and the thread will be interrupted. Since the server is being shutdown, we should let the client know.
259+
// When the HTTPServerThread shuts down, we will interrupt each client thread, so debug log it accordingly.
260+
// - This will cause the socket to throw a SocketException, so log it.
261261
if (Thread.currentThread().isInterrupted()) {
262-
// Close socket only. We do not want to potentially delay the shutdown at all.
263262
logger.debug("[{}] Closing socket. Server is shutting down.", Thread.currentThread().threadId());
264-
closeSocketOnly(CloseSocketReason.Expected);
263+
} else {
264+
logger.debug("[{}] Closing socket. The socket was closed by a client, proxy or otherwise.", Thread.currentThread().threadId());
265265
}
266+
closeSocketOnly(CloseSocketReason.Expected);
266267
} catch (IOException e) {
267268
logger.debug(String.format("[%s] Closing socket with status [%d]. An IO exception was thrown during processing. These are pretty common.", Thread.currentThread().threadId(), Status.InternalServerError), e);
268269
closeSocketOnError(response, Status.InternalServerError);

0 commit comments

Comments
 (0)