Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spurious NullPointerException in ArrayByteBufferPool.release() #12623

Open
loetifuss opened this issue Dec 10, 2024 · 5 comments
Open

spurious NullPointerException in ArrayByteBufferPool.release() #12623

loetifuss opened this issue Dec 10, 2024 · 5 comments
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@loetifuss
Copy link

loetifuss commented Dec 10, 2024

Jetty version(s)
Jetty 12.0.15

Jetty Environment
core

Java version/vendor (use: java -version)
JDK 17.0.12

OS type/version
RedHat Linux

Description
After upgrading from Jetty 9 to 12 we're experiencing intermittent NullPointerExceptions, mostly from EventSourceSevlet.
Jetty is running embedded in an OSGI environment.

java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.io.RetainableByteBuffer.getByteBuffer()" because "buffer" is null
	at org.eclipse.jetty.io.ArrayByteBufferPool.release(ArrayByteBufferPool.java:281)
	at org.eclipse.jetty.io.ArrayByteBufferPool$Buffer.release(ArrayByteBufferPool.java:653)
	at org.eclipse.jetty.io.ArrayByteBufferPool.removeAndRelease(ArrayByteBufferPool.java:244)
	at org.eclipse.jetty.ee10.servlet.HttpOutput.lockedReleaseBuffer(HttpOutput.java:605)
	at org.eclipse.jetty.ee10.servlet.HttpOutput.onWriteComplete(HttpOutput.java:226)
	at org.eclipse.jetty.ee10.servlet.HttpOutput.flush(HttpOutput.java:690)
	at org.eclipse.jetty.ee10.servlet.ServletApiResponse.flushBuffer(ServletApiResponse.java:405)
	at org.eclipse.jetty.ee10.servlets.EventSourceServlet$EventSourceEmitter.flush(EventSourceServlet.java:223)
	at org.eclipse.jetty.ee10.servlets.EventSourceServlet$EventSourceEmitter.data(EventSourceServlet.java:169)

How to reproduce?

Not yet reproducible, seems to occur mostly during daytime under load:

image

@loetifuss loetifuss added the Bug For general bugs on Jetty side label Dec 10, 2024
@joakime
Copy link
Contributor

joakime commented Dec 10, 2024

Upgrade to Jetty 12.0.15 at least, and try again.
This is fixed already.

@loetifuss
Copy link
Author

Upgrading to Jetty 12.0.15 didn't help. Still seeing these errors frequently.

@gregw
Copy link
Contributor

gregw commented Dec 19, 2024

@loetifuss Can you tell us anything else about the requests and responses? How are they read/generated? Are they big/small? Are they json/binary/??? Are you writing async or blocking? When it is not from the EventSourceServlet, where is it from?

@gregw
Copy link
Contributor

gregw commented Dec 19, 2024

@lorban My reading of the code is that the entry can only have a null buffer if it has not yet been enabled, or was enabled but the pool was terminated

@loetifuss Can you also tell us if you configure your buffer pool? If so then how?

@lorban
Copy link
Contributor

lorban commented Dec 20, 2024

@gregw your reading is right if the entry was a ConcurrentEntry instance, but I'm wondering if that instance wasn't a QueuedEntry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

4 participants