apache / apache/fluss

Netty globalEventExecutor leak classloader in flink catalog.

Open
#2,198 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.1k
Forks
625
Avg merge
3d 14h
Merged PRs (30d)
97

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar.

### Fluss version

0.8.0 (latest release)

### Please describe the bug 🐞

Currently, flink gateway with fluss long time running, will thread leak. When dump the thread, there are lots of threads(named globalEventExecutor-2-2) left.
```shell
Thread/Slack: org.apache.fluss.shaded.netty4.io.netty.util.concurrent.FastThreadLocad @0001
name: globalEventExecutor-2-2
Thread/Slack: org.apache.fluss.shaded.netty4.io.netty.util.concurrent.FastThreadLocad @0002
name: globalEventExecutor-2-1
...... lot of ....
```

It seems the problem of https://github.com/netty/netty/issues/14615
> If Netty is on a main classpath in a system that creates ephemeral classloaders, e.g. for plug-ins, then we should avoid holding on to those ephemeral classloaders.

The fluss connector is in the main classpath, and gateway will create ephemeral classloaders.

### Solution

_No response_

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the long-running Flink gateway with Fluss 0.8.0 and inspect the leaked globalEventExecutor threads described in the report. Read the linked Netty issue and trace how the Fluss connector and gateway ephemeral classloaders interact; done means the gateway no longer accumulates these threads or retains their classloaders.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.