spiffe/java-spiffe

FD leak when creating sources

IvMdlc opened this issue · 1 comments

Lib version:
java-spiffe-core 0.8.1
grpc-netty-linux 0.8.1

OS
Linux 3.10.0-1160.53.1.el7.x86_64 #1 SMP Fri Jan 14 13:59:45 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Steps

        try (DefaultX509Source defaultX509Source = DefaultX509Source.newSource()) {
            defaultX509Source.getX509Svid();
        } catch (SocketEndpointAddressException | X509SourceException e) {
            //
        }

lsof shows that it allocates a number of

java    27621 user  362u  a_inode               0,10           0       8771 [eventpoll]
java    27621 user  363u  a_inode               0,10           0       8771 [eventfd]
java    27621 user  364u  a_inode               0,10           0       8771 [timerfd]

which are never closed.

From the release notes of 0.8.1:

Upgrade gRPC dependencies to 1.51.1 (https://github.com/spiffe/java-spiffe/pull/101)

the issue might be there, as this leak does not happen with 0.8.0.

Fixed in #112.
Released in v0.8.2