blob: 49454a173b438428da5525bff683f3ff580c1fe4 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.18">
<link rel="icon" type="image/png" href="images/favicon.png">
<title>Critical Analysis of the broker</title>
<link rel="stylesheet" href="css/asciidoctor.css">
<link rel="stylesheet" href="css/font-awesome.css">
</head>
<body class="book toc2 toc-left">
<div id="header">
<h1>Critical Analysis of the broker</h1>
<div id="toc" class="toc2">
<div id="toctitle"><a href="index.html">User Manual for 2.32.0</a></div>
<ul class="sectlevel1">
<li><a href="#what-to-expect">1. What to Expect</a></li>
</ul>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>There are a few things that can go wrong on a production environment:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Bugs, for more than we try they still happen!
We always try to correct them, but that&#8217;s the only constant in software development.</p>
</li>
<li>
<p>IO Errors, disks and hardware can go bad</p>
</li>
<li>
<p>Memory issues, the CPU can go crazy by another process</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>For cases like this, we added a protection to the broker to shut itself down when bad things happen.</p>
</div>
<div class="paragraph">
<p>This is a feature I hope you won&#8217;t need it, think it as a safeguard:</p>
</div>
<div class="paragraph">
<p>We measure time response in places like:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Queue delivery (add to the queue)</p>
</li>
<li>
<p>Journal storage</p>
</li>
<li>
<p>Paging operations</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If the response time goes beyond a configured timeout, the broker is considered unstable and an action will be taken to either shutdown the broker or halt the VM.</p>
</div>
<div class="paragraph">
<p>You can use these following configuration options on broker.xml to configure how the critical analysis is performed.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">critical-analyzer</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Enable or disable the critical analysis (default true)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">critical-analyzer-timeout</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Timeout used to do the critical analysis (default 120000 milliseconds)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">critical-analyzer-check-period</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Time used to check the response times (default half of critical-analyzer-timeout)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">critical-analyzer-policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Should the server log, be halted or shutdown upon failures (default <code>LOG</code>)</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>The default for critical-analyzer-policy is <code>LOG</code>, however the generated broker.xml will have it set to <code>HALT</code>.
That is because we cannot halt the VM if you are embedding ActiveMQ Artemis into an application server or on a multi tenant environment.</p>
</div>
<div class="paragraph">
<p>The broker on the distribution will then have it set to <code>HALT</code>, but if you use it in any other way the default will be <code>LOG</code>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="what-to-expect"><a class="anchor" href="#what-to-expect"></a><a class="link" href="#what-to-expect">1. What to Expect</a></h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>You will see some logs</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If you have critical-analyzer-policy=HALT</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="nowrap">[Artemis Critical Analyzer] 18:10:00,831 ERROR [org.apache.activemq.artemis.core.server] AMQ224079: The process for the virtual machine will be killed, as component org.apache.activemq.artemis.tests.integration.critical.CriticalSimpleTest$2@5af97850 is not responsive</pre>
</div>
</div>
<div class="paragraph">
<p>While if you have critical-analyzer-policy=<code>SHUTDOWN</code></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="nowrap">[Artemis Critical Analyzer] 18:07:53,475 ERROR [org.apache.activemq.artemis.core.server] AMQ224080: The server process will now be stopped, as component org.apache.activemq.artemis.tests.integration.critical.CriticalSimpleTest$2@5af97850 is not responsive</pre>
</div>
</div>
<div class="paragraph">
<p>Or if you have critical-analyzer-policy=LOG</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="nowrap">[Artemis Critical Analyzer] 18:11:52,145 WARN [org.apache.activemq.artemis.core.server] AMQ224081: The component org.apache.activemq.artemis.tests.integration.critical.CriticalSimpleTest$2@5af97850 is not responsive</pre>
</div>
</div>
<div class="paragraph">
<p>You will see a simple thread dump of the server</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="nowrap">[Artemis Critical Analyzer] 18:10:00,836 WARN [org.apache.activemq.artemis.core.server] AMQ222199: Thread dump: AMQ119001: Generating thread dump
*******************************************************************************
===============================================================================
AMQ119002: Thread Thread[Thread-1 (ActiveMQ-scheduled-threads),5,main] name = Thread-1 (ActiveMQ-scheduled-threads) id = 19 group = java.lang.ThreadGroup[name=main,maxpri=10]
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1088)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
===============================================================================
..... blablablablaba ..........
===============================================================================
AMQ119003: End Thread dump
*******************************************************************************</pre>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p>The Server will be halted if configured to <code>HALT</code></p>
</li>
<li>
<p>The system will be stopped if <code>SHUTDOWN</code> is used.
<strong>Notice</strong>: If the system is not behaving well, there is no guarantees the stop will work.</p>
</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>