ODB Log prints nothing:
[2021-04-16 18:26:25 #1 server]
Server on port 10054 has started by 26621@testing
TCP Dump over all interfaces did not print anything (assuming no network connections were done)
sudo tcpdump -ni lo port 10054
We had also strace running to print all network related kernel calls from process:
Based on that 2 times a during day the ODB Server went crazy, created cuple of threads and started creating sockets in some loop.
This took about minute, so I will try to create java thread dump during that.
[pid 26650] 02:48:00.246356 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 46494>
[pid 26650] 02:48:00.250400 setsockopt(46494>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 26650] 02:48:00.253569 getsockopt(46494>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
[pid 26650] 02:48:00.256978 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 52186>
[pid 26650] 02:48:00.262088 setsockopt(52186>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 26650] 02:48:00.265851 getsockopt(52186>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
[pid 26650] 02:48:00.269934 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 55389>
[pid 26650] 02:48:00.274090 setsockopt(55389>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
...
[pid 26650] 02:49:20.166210 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 80620>
[pid 26650] 02:49:20.168344 setsockopt(80620>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 26650] 02:49:20.170243 getsockopt(80620>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
[pid 26650] 02:49:20.172080 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 80621>
[pid 26650] 02:49:20.173949 setsockopt(80621>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 26650] 02:49:20.175771 getsockopt(80621>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
[pid 26650] 02:49:20.177615 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 80622>
Next occurence couple hours later.
strace: Process 33702 attached
[pid 26650] 22:12:27.202012 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 11>
[pid 26650] 22:12:27.206298 setsockopt(11>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 26650] 22:12:27.208845 getsockopt(11>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
[pid 26650] 22:12:27.211548 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 12>
[pid 26650] 22:12:27.216027 setsockopt(12>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 26650] 22:12:27.220703 getsockopt(12>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
[pid 26650] 22:12:27.225259 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 13>
[pid 26650] 22:12:27.227884 setsockopt(13>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
....
[pid 26650] 22:13:17.024203 getsockopt(6783>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
[pid 26650] 22:13:17.026705 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 6784>
[pid 26650] 22:13:17.029276 setsockopt(6784>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 26650] 22:13:17.031247 getsockopt(6784>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
[pid 26650] 22:13:17.033553 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 6785>
[pid 26650] 22:13:17.035586 setsockopt(6785>, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0
[pid 26650] 22:13:17.037957 getsockopt(6785>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, [8]) = 0
Here is example of strace log during standard connection made from our app:
[pid 26632] 12:04:35.478979 accept(7>, {sa_family=AF_INET6, sin6_port=htons(37970), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, [28]) = 80623->::ffff:127.0.0.1:37970]>
[pid 26632] 12:04:35.485544 getsockname(80623->::ffff:127.0.0.1:37970]>, {sa_family=AF_INET6, sin6_port=htons(10054), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, [28]) = 0
[pid 26632] 12:04:35.485673 getsockname(80623->::ffff:127.0.0.1:37970]>, {sa_family=AF_INET6, sin6_port=htons(10054), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, [28]) = 0
[pid 26632] 12:04:35.490411 setsockopt(80623->::ffff:127.0.0.1:37970]>, SOL_TCP, TCP_NODELAY, [1], 4) = 0
[pid 26632] 12:04:35.490627 setsockopt(80623->::ffff:127.0.0.1:37970]>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, 8) = 0
[pid 26632] 12:04:35.670835 setsockopt(80623->::ffff:127.0.0.1:37970]>, SOL_TCP, TCP_NODELAY, [1], 4) = 0
[pid 26632] 12:04:35.670983 setsockopt(80623->::ffff:127.0.0.1:37970]>, SOL_SOCKET, SO_LINGER, {l_onoff=0, l_linger=0}, 8) = 0
I tried to start ObjectDB Server on my working computer with MacOS for few hours without connecting to it, and it is also doing the same thing.
Lsof output from macOS looks differently:
java 16328 thommy 16u IPv6 0x88d67f9ab22f022b 0t0 TCP *:* (CLOSED)
java 16328 thommy 17u IPv6 0x88d67f9ab743c22b 0t0 TCP *:* (CLOSED)
java 16328 thommy 18u IPv6 0x88d67f9ab743fbab 0t0 TCP *:* (CLOSED)
java 16328 thommy 19u IPv6 0x88d67f9ab743f54b 0t0 TCP *:* (CLOSED)
java 16328 thommy 20u IPv6 0x88d67f9ab743eeeb 0t0 TCP *:* (CLOSED)
java 16328 thommy 21u IPv6 0x88d67f9ab743e88b 0t0 TCP *:* (CLOSED)
java 16328 thommy 22u IPv6 0x88d67f9ab743e22b 0t0 TCP *:* (CLOSED)
java 16328 thommy 23u IPv6 0x88d67f9ab7441bab 0t0 TCP *:* (CLOSED)
java 16328 thommy 24u IPv6 0x88d67f9ab744154b 0t0 TCP *:* (CLOSED)
java 16328 thommy 25u IPv6 0x88d67f9ab7440eeb 0t0 TCP *:* (CLOSED)
java 16328 thommy 26u IPv6 0x88d67f9ab744088b 0t0 TCP *:* (CLOSED)
For me those are closed connections which are still wasting system resources, and I have 8000 of them for few hours.
Please try it yourself, if it does not behave like this also for You.
For me it's sufficient to just start the server and leave it running for several hours.