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

switch toByteBuffer from direct to indirect #707

Closed
stevehu opened this issue May 13, 2020 · 1 comment
Closed

switch toByteBuffer from direct to indirect #707

stevehu opened this issue May 13, 2020 · 1 comment

Comments

@stevehu
Copy link
Contributor

stevehu commented May 13, 2020

The UTF8 string length is not predictable and the performance gain is unknown. To avoid issues like below, switch to wrap instead.

12:55:36.148 [XNIO-1 task-154]   ERROR c.n.exception.ExceptionHandler handleRequest - Exception:
java.nio.BufferOverflowException: null
	at java.base/java.nio.DirectByteBuffer.put(DirectByteBuffer.java:410)
	at java.base/java.nio.ByteBuffer.put(ByteBuffer.java:906)
	at com.networknt.utility.NioUtils.toByteBuffer(NioUtils.java:253)
	at net.lightapi.portal.covid.query.handler.GetWebsiteByEmail.handle(GetWebsiteByEmail.java:49)
	at com.networknt.rpc.router.JsonHandler.processRequest(JsonHandler.java:88)
	at com.networknt.rpc.router.JsonHandler.handleRequest(JsonHandler.java:56)
	at com.networknt.handler.Handler.next(Handler.java:208)
	at com.networknt.handler.Handler.next(Handler.java:229)
	at com.networknt.cors.CorsHttpHandler.handleRequest(CorsHttpHandler.java:74)
	at com.networknt.handler.Handler.next(Handler.java:208)
	at com.networknt.handler.Handler.next(Handler.java:229)
	at com.networknt.jaeger.tracing.JaegerHandler.handleRequest(JaegerHandler.java:123)
	at com.networknt.handler.Handler.next(Handler.java:208)
	at com.networknt.handler.Handler.next(Handler.java:229)
	at com.networknt.exception.ExceptionHandler.handleRequest(ExceptionHandler.java:76)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

@stevehu
Copy link
Contributor Author

stevehu commented May 13, 2020

younggwon1 pushed a commit to younggwon1/light-4j that referenced this issue Feb 10, 2024
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

No branches or pull requests

1 participant