question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

file descriptor leak per connection

See original GitHub issue

Using Conscrypt for TLS with a java webserver, each connection leaves a pipe open. The server will crash once the limit is reached, easiest way I’ve found to reproduce is by using ab (Apache Benchmark) which doesn’t reuse connections.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AnywhereSoftwarecommented, May 21, 2018

Probably the same issue posted in Jetty bug tracker: https://github.com/eclipse/jetty.project/issues/2342

0reactions
radifalcocommented, Nov 28, 2018

@flooey Is it okay if it is dropwizard? I bet I could cut it down. Basically I have a dropwizard app under Java 11 running HTTP/2. If I create an HTTPS client that does 10,024 posts from 256 threads, I get the file exhausted handles error. Even though I think I’ve bumped up my ulimit pretty high. I’m using these deps:

        <dependency>
            <groupId>org.conscrypt</groupId>
            <artifactId>conscrypt-openjdk-uber</artifactId>
            <version>1.4.1</version>
        </dependency>
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-http2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-alpn-conscrypt-server</artifactId>
            <version>9.4.11.v20180605</version>
        </dependency>

So just one resource with a post. Then 256 threads doing 10,100K posts. The posts can be empty. I basically eventually get a bunch of these:

WARN  [2018-11-28 23:11:57,759] org.eclipse.jetty.server.AbstractConnector:
! java.io.IOException: Too many open files
! at java.base/sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
! at java.base/sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:533)
! at java.base/sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:285)
! at org.eclipse.jetty.server.ServerConnector.accept(ServerConnector.java:369)
! at org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:639)
! at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
! at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
! at java.base/java.lang.Thread.run(Thread.java:834)
Read more comments on GitHub >

github_iconTop Results From Across the Web

File descriptor leak. Very hard to reproduce in development.
I developed a full project in vert.x and I noticed a file descriptor leak in production. I have a 50 files descriptor leak...
Read more >
Fixing File Descriptor Leaks - DSpace@MIT
Abstract. We design, implement and test a tool for eliminating file descriptor (FD) leaks in programs at run-time. Our tool monitors FD ......
Read more >
Fixing File Descriptor Leaks in Long-Lived Servers
Leaked file handles can come from many sources, not just open files. Some common sources are: Sockets: Every socket also opens a file...
Read more >
How to identify leaked file descriptors that are shown only as ...
In Linux operating system every file or socket is associated with a file descriptor. Incorrectly closing these could cause a file descriptor leak....
Read more >
In Go, what are the best practices to find open socket/file ...
The code has a connections leak here, i.e. after some running time ... The reason seems to be creation of the transport for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found