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
ARTEMIS-2984 Compressed large messages can leak native resources #3334
Conversation
6990319
to
a8b2090
Compare
import org.apache.activemq.artemis.api.core.ActiveMQException; | ||
|
||
public interface LargeMessageController extends ActiveMQBuffer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an API change, isn't?
it's part of the Core Client API when dealing with large messages...
it's a client API.. I don't think. you can guarantee there are no users using this API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
answered on #3334 (comment)
@@ -104,42 +103,6 @@ public void testDeflaterReader2() throws Exception { | |||
compareByteArray(allCompressed, output, compressedDataLength); | |||
} | |||
|
|||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happened to this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InflaterReader
was no longer needed, so could be removed (need to be sure of this one yet)!
.../org/apache/activemq/artemis/tests/unit/core/client/impl/ReadableLargeMessageController.java
Outdated
Show resolved
Hide resolved
@clebertsuconic I'm reworking on this to save users to break their expectations but I see some interesting things that could improve large message streaming, see: private byte getByte(final long index) {
checkForPacket(index);
if (fileCache != null && index < packetPosition) {
return fileCache.getByteFromCache(index);
} else {
return currentPacket.getChunk()[(int) (index - packetPosition)];
}
} This method is the only one using |
480a877
to
a8a3adc
Compare
a8a3adc
to
fd02ad4
Compare
@franz1981 I'm lost on what you mean on your last comment.. you mean we should remove usage, or you have already reworked the usage? |
I haven't done it because of the |
@franz1981 what about the previous propose? to make the usage separate? we break the API but allow an alternative? you had a class that you had moved to tests.. all I asked you was to move that class to the API.. so if someone is broken by this they could just change their code to use this new class. they are using an internal method.. they would be broken by it.. but at least they would have an alternative. if that's not possible then we can talk about breaking it for sure. |
Do we really expose the controller to users? Yes its public but is it exposed in the client apis? I didnt think we do. |
�we don't expose it... Franz had moved the controller to a separate class on a test.. all I asked was to have that class as part of the main jar. But if that's a big deal.. just take it out then. |
@michaelandrepearce @clebertsuconic If we take the step to remove it I'm sure large message streaming can just drop any file cache and both code and perf will benefit there
If the usage wasn't exposed to users, to remove the whole code paths that makes large msg streaming complex, saving both perf and leaky methods to exists as a whole. If removing isn't an option I can just prepare the code for a future removal, when we decide to do that, but we won't get any perf and stability benefits from removing it. |
@franz1981 i think we established end users dont see this class we can do with it as we want. Removal, refactor, give it cups of tea. |
Please don't merge it, I'm still trying to be 100% sure that file cache isn't used..but maybe it's used somehow... |
If it's easy. Keep the class available like before. If not. Just take it out. Keep it simple. |
As it is now is just packed in a different class to make it more readeable :) |
bytesRead += read; | ||
} | ||
while (bytesRead < chunkLimit); | ||
assert bytesRead == chunkLimit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this assert correct? what if you are reading a large message that Is not a multiple of chunkLimit?
@franz1981 what's the status on this PR? is this ready to merge? I saw briefly one assert (that I added a comment) that I wasn't sure at a first look. |
@clebertsuconic / @franz1981 whats occuring with this, wanting to start clearing down old / stagnant PR's a bit of spring cleaning so to say - so we focus on stuff thats actively working on / relevant . |
Closing this because large messages changed a bit recently: need to be reworked |
https://issues.apache.org/jira/browse/ARTEMIS-2984