Skip to content

Conversation

@adutra
Copy link
Contributor

@adutra adutra commented Jan 16, 2025

This was due to the fact that each token fetch created a new client, and the client wasn't closed.

The typical stack trace is:

failed to open a new selector
io.netty.channel.ChannelException: failed to open a new selector
	at app//io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:179)
...
	at app//org.apache.polaris.service.it.ext.PolarisServerManager.createClient(PolarisServerManager.java:64)
	at app//org.apache.polaris.service.it.ext.PolarisServerManager.accessManager(PolarisServerManager.java:55)
	at app//org.apache.polaris.service.it.env.PolarisClient.obtainToken(PolarisClient.java:118)
	at app//org.apache.polaris.service.it.env.PolarisClient.managementApi(PolarisClient.java:88)
	at app//org.apache.polaris.service.it.env.PolarisClient.cleanUp(PolarisClient.java:126)
...
Caused by: java.io.IOException: Too many open files
	at java.base/sun.nio.ch.KQueue.create(Native Method)
	at java.base/sun.nio.ch.KQueueSelectorImpl.<init>(KQueueSelectorImpl.java:83)
	at java.base/sun.nio.ch.KQueueSelectorProvider.openSelector(KQueueSelectorProvider.java:36)
	at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:177)
	... 32 more

This was due to the fact that each token fetch created a new client, and the client wasn't closed.
Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, nice catch

@adutra adutra merged commit 51a4537 into apache:main Jan 16, 2025
5 checks passed
@adutra adutra deleted the access-manager-fix branch January 16, 2025 12:10
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Sorry I missed it when I added PolarisAccessManager 🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants