[
https://issues.apache.org/jira/browse/ARTEMIS-5694?focusedWorklogId=986319&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-986319
]
ASF GitHub Bot logged work on ARTEMIS-5694:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 08/Oct/25 13:44
Start Date: 08/Oct/25 13:44
Worklog Time Spent: 10m
Work Description: brusdev commented on code in PR #5952:
URL: https://github.com/apache/activemq-artemis/pull/5952#discussion_r2413915007
##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerImpl.java:
##########
@@ -49,28 +52,53 @@ public CriticalAnalyzerImpl() {
* otherwise in case of a deadlock, or a starvation of the server the
analyzer won't pick up any
* issues and won't be able to shutdown the server or halt the VM
*/
- this.scheduledComponent = new ActiveMQScheduledComponent(null, null,
checkTimeNanoSeconds, TimeUnit.NANOSECONDS, false) {
+ this.scheduledComponent = new CriticalAnalyzerScheduledComponent(this,
null, null, checkTimeNanoSeconds, checkTimeNanoSeconds, TimeUnit.NANOSECONDS,
false);
- @Override
- public void run() {
- logger.trace("Checking critical analyzer");
- check();
- }
+ }
- @Override
- protected ActiveMQThreadFactory getThreadFactory() {
- return new ActiveMQThreadFactory("critical-analyzer", true,
getThisClassLoader());
- }
+ private static class CriticalAnalyzerScheduledComponent extends
ActiveMQScheduledComponent {
- private ClassLoader getThisClassLoader() {
- return
AccessController.doPrivileged((PrivilegedAction<ClassLoader>) () ->
CriticalAnalyzerImpl.this.getClass().getClassLoader());
+ private final CriticalAnalyzerImpl criticalAnalyzer;
- }
+ public CriticalAnalyzerScheduledComponent(CriticalAnalyzerImpl
criticalAnalyzer,
+ ScheduledExecutorService
scheduledExecutorService,
+ Executor executor,
+ long initialDelay,
+ long checkPeriod,
+ TimeUnit timeUnit,
+ boolean onDemand) {
+ super(scheduledExecutorService, executor, initialDelay, checkPeriod,
timeUnit, onDemand);
+ this.criticalAnalyzer = criticalAnalyzer;
+ }
+
+
+ @Override
+ public void run() {
+ logger.trace("Checking critical analyzer");
+ criticalAnalyzer.check();
+ }
+
+ @Override
+ protected ActiveMQThreadFactory getThreadFactory() {
+ return new ActiveMQThreadFactory("critical-analyzer", true,
getThisClassLoader());
+ }
+
+ private ClassLoader getThisClassLoader() {
+ return AccessController.doPrivileged((PrivilegedAction<ClassLoader>)
() -> criticalAnalyzer.getClass().getClassLoader());
+ }
+
+ /** Schedule an action to kick in the critical analyzer.
+ * If this future is not cancelled in time, the critical analyzer will
kick in. */
+ public ScheduledFuture<?> kickIt(CriticalComponent component) {
+ return scheduledExecutorService.schedule(() -> {
+ criticalAnalyzer.fireActions(component);
+ }, period, timeUnit);
+ }
Review Comment:
LGTM
Issue Time Tracking
-------------------
Worklog Id: (was: 986319)
Time Spent: 1h 40m (was: 1.5h)
> Lingering sessions after a storage timeout
> ------------------------------------------
>
> Key: ARTEMIS-5694
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5694
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Affects Versions: 2.42.0
> Reporter: Clebert Suconic
> Assignee: Clebert Suconic
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.43.0
>
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> We had reports of sessions not closing for an unkown situation, probably on
> storage.
> I am adding a timeout verification and adding extra logs in case this happens.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact