[
https://issues.apache.org/jira/browse/ARTEMIS-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15952067#comment-15952067
]
ASF GitHub Bot commented on ARTEMIS-1025:
-----------------------------------------
Github user franz1981 commented on the issue:
https://github.com/apache/activemq-artemis/pull/1119
@clebertsuconic Exactly, it tries to block it for a finite amount of time
and only if not in the event loop: you've mentioned about stalling behaviours
and I've dig in the Netty code to find out a possible reason of it, finding
only 1 answer: maybe we share the I/O threads (via a pool?) with Netty and
calling ``writeAndFlush`` while on one of them.
Altought it is considered legal, IMHO is something that must be avoided
because it increases the risk to go OOM (it steals time to a thread that would
be happier while doing I/O stuff and releasing the sent ``ByteBuf``s) and it
will lead to unexpected infinite stalls...
It could be the key to solve other strange blocking behaviours happening on
replication too!
Anwers:
i - The original behaviour was already to perform a ``writeAndFlush``
there, but without applying any backpressure on the caller, streaming huge
messages with clusters (with 1 GB per msg) would lead anyway to log some warns
but then going OOM.
As you said we need to perform flow control in our codebase, but the
granularity allowed using Netty in idiomatic way couldn't be enough: a
"writable" flag is good for the most cases but not enough with very high
traffic with long burst of data (=== streaming huge messages in batches).
Maybe we need an API change, like returning a ``boolean`` on the
``NettyConnection::write`` method, in order to let the caller choose what to do
as part of its duties, but is weird ( as a user, I mean).
Monday we could talk about it better or I could ask on the forum for
feedbacks: solving it properly will improve Artemis a lot, I'm sure of it :+1:
ii - :100: No more crazy properties
Thanks Cleb!!!
> OutOfDirectMemoryError raised from Netty
> ----------------------------------------
>
> Key: ARTEMIS-1025
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1025
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Broker
> Reporter: Francesco Nigro
> Assignee: Francesco Nigro
>
> If you send and receive a lot of messages in short time to Artemis via Netty
> connector, the OutOfDirectMemoryError exception is thrown from the client.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)