Projects tigase _server server-core Issues #1542
Add option to configure Socket TCP KeepAlive settings (#1542)
Andrzej Wójcik (Tigase) opened 8 months ago

According to the answer as StackOverflow, since JDK 11 it is possible to configure Socket TCP keep alive settings.

We do recommend configuring those on the operating system level for best results, but it would be good to allow configuring that within Tigase XMPP Server, so that just for Tigase XMPP connections would be configured to use those settings and it would not have any impact on other applications running on the same server. That would be very desirable, ie. for Tigase XMPP Server deployed on a Kubernetes cluster.

  • Wojciech Kapcia (Tigase) commented 8 months ago

    For posterity:

    Javadoc: https://docs.oracle.com/en/java/javase/21/docs/api/jdk.net/jdk/net/ExtendedSocketOptions.html

    Example:

    Socket socket = new Socket();
    socket.setOption(ExtendedSocketOptions.TCP_KEEPIDLE, 10);
    socket.setOption(ExtendedSocketOptions.TCP_KEEPCOUNT, 2);
    socket.setOption(ExtendedSocketOptions.TCP_KEEPINTERVAL, 3);
    
  • Wojciech Kapcia (Tigase) added "Related" tigase/helm-charts#3 8 months ago
  • Wojciech Kapcia (Tigase) added "Related" tigase/_server/tigase-server#25 8 months ago
  • Wojciech Kapcia (Tigase) changed state to 'In Progress' 8 months ago
    Previous Value Current Value
    Open
    In Progress
  • Wojciech Kapcia (Tigase) changed state to 'In QA' 8 months ago
    Previous Value Current Value
    In Progress
    In QA
  • Wojciech Kapcia (Tigase) commented 8 months ago

    Added the configuration. @andrzej.wojcik - what do you think?

    @kobit @andrzej.wojcik I was pondering if we should adjust watchdog settings and decrease interval/timeout as that would significantly speed up detection of broken connections, and in today's world most of the deployments are oriented toward mobile users. The downside is of course higher impact on the server, but for c2s we could stick with whitespace ping still.

  • Wojciech Kapcia (Tigase) commented 8 months ago

    Updated base docker image as the functionality requires jdk.net module, which we didn't have in jlink…:

    xmpp-1  | [2024-09-24 15:49:26:657] [SEVERE  ] [  ConnectionOpenThread ] ThreadExceptionHandler.uncaughtException(): Uncaught thread: "ConnectionOpenThread" exception
    xmpp-1  | java.lang.NoClassDefFoundError: jdk/net/ExtendedSocketOptions
    xmpp-1  | 	at tigase.io.SocketIO.<init>(SocketIO.java:75)
    xmpp-1  | 	at tigase.net.IOService.accept(IOService.java:168)
    xmpp-1  | 	at tigase.server.ConnectionManager$ConnectionListenerImpl.accept(ConnectionManager.java:1256)
    xmpp-1  | 	at tigase.net.ConnectionOpenThread.run(ConnectionOpenThread.java:179)
    xmpp-1  | 	at java.base/java.lang.Thread.run(Unknown Source)
    xmpp-1  | Caused by: java.lang.ClassNotFoundException: jdk.net.ExtendedSocketOptions
    xmpp-1  | 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    xmpp-1  | 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    xmpp-1  | 	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    xmpp-1  | 	... 5 more
    
issue 1 of 1
Type
Task
Priority
Normal
Assignee
Version
8.5.0
Sprints
n/a
Customer
n/a
Iterations
Issue Votes (0)
Watchers (3)
Reference
tigase/_server/server-core#1542
Please wait...
Page is in error, reload to recover