You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Clebert Suconic (Jira)" <ji...@apache.org> on 2022/03/22 18:57:00 UTC

[jira] [Closed] (ARTEMIS-3618) Faster Artemis CORE client MessageListener::onMessage without SecurityManager

     [ https://issues.apache.org/jira/browse/ARTEMIS-3618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clebert Suconic closed ARTEMIS-3618.
------------------------------------
    Fix Version/s: 2.21.0
       Resolution: Fixed

> Faster Artemis CORE client MessageListener::onMessage without SecurityManager
> -----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3618
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3618
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Major
>             Fix For: 2.21.0
>
>         Attachments: noSecurityManager.png
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently {{{}ClientConsumerImpl{}}}, responsible of calling JMS {{{}MessageListener::onMessage{}}}, is installing/restoring the listener thread's context ClassLoader by using a secured action regardless any security manager is installed.
> This secured action (using {{{}AccessController::doPrivileged{}}}) is very heavyweight and can often be as costy (or more) then the user/application code handling the received message (see [https://bugs.openjdk.java.net/browse/JDK-8062162] for more info).
> The {{SecurityManager}} will be removed in the future (see [https://openjdk.java.net/jeps/411]) but until that moment would be nice to reduce such cost at least if no {{SecurityManager}} is installed.
> This is a flamegraph showing the listener stack trace:
> !noSecurityManager.png|width=920,height=398!
> As the image shows, in violet, here's the cost of {{AccessController::doPrivileged}} if no {{SecurityManager}} is installed ie 14 samples
>  - handling the message costs 3 samples
>  - acknowledge it costs 19 samples
> TLDR {{AccessController::doPrivileged}} cost ~5 times handling the message and nearly the same as acking back it



--
This message was sent by Atlassian Jira
(v8.20.1#820001)