-
Notifications
You must be signed in to change notification settings - Fork 908
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
ByteBuf returned by BookKeeper triggers CRC Checksum calculation when calling "readBytes" #4372
Comments
that seems like a strange flamegraph. I don't see how readBytes could trigger CRC calculation. ByteBufVisitor is used in checksum calculations: bookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/checksum/DigestManager.java Lines 69 to 71 in f8eb7a0
PR was #4196 |
The ByteBuf was not coming from a read from the BookKeeper client, because the ByteBug is coming from the network (it is the Pulsar producer that is sending a message and the interceptor processes it) But maybe it is a ByteBuf recycled ? |
It's hard to see how it could result in the stacktrace even if there was a recycling bug. bookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/ByteBufVisitor.java Line 138 in f8eb7a0
Perhaps it's a profiler issue. Please add
It might also be useful to compare Async Profiler 2.9 and 3.0 results. Just to be sure that the new stacktrace solution in 3.0 isn't causing the problem. |
@hangc0276 I guess it is expected to consume a lot of CPU? In Enrico's case, the flamegraph doesn't seem to be valid and my assumption was that adding |
BUG REPORT
Describe the bug
I have developting a Pulsar BrokerInterceptor. The BrokerInterceptor is able to process the data that Pulsar read from BookKeeper, without memory copies.
While analysing a flamegraph I have seen that the ByteBuf returned by BookKeeper shows this weird behaviour and uses lot of CPU.
This is a flame graph. The version of BookKeeper is based on latest 4.16.x
To Reproduce
See the flamegraph
Expected behavior
readBytes has very little overhead
The text was updated successfully, but these errors were encountered: