cryostatio / cryostatio/cryostat-web

[Task] Deleting automated rule deletes active recording twice for aliased targets

Open
#455 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
13
Forks
21
Avg merge
1d 10h
Merged PRs (30d)
42

Description

Related to #325?

If there are multiple connect URLs pointing to the same target, and an automated rule's match expression matches both URLs, deleting the automated rule will attempt to delete the active recording associated with that automated rule twice. The second attempt results in a `RecordingNotFoundException` logged in the backend.

1) Add a custom target with connect URL `cryostat:9093`
2) Start an automated rule with match expression `true` to match all target connect URLs
3) Delete the automated rule. All active automated rule recordings will get deleted, and this exception is thrown:

```
INFO: Connection for service:jmx:rmi:///jndi/rmi://cryostat:9093/jmxrmi closed
Jun 09, 2022 7:26:42 PM io.cryostat.core.log.Logger error
SEVERE: Exception thrown
java.util.concurrent.ExecutionException: io.cryostat.recordings.RecordingNotFoundException: Recording auto_test not found in target active recordings
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at io.cryostat.rules.PeriodicArchiver.performArchival(PeriodicArchiver.java:154)
at io.cryostat.rules.PeriodicArchiver.run(PeriodicArchiver.java:132)
at io.cryostat.rules.RuleProcessor.lambda$activate$8(RuleProcessor.java:219)
at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:889)
at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:860)
at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:50)
at io.vertx.core.impl.DuplicatedContext.emit(DuplicatedContext.java:168)
at io.vertx.core.impl.AbstractContext.emit(AbstractContext.java:53)
at io.vertx.core.impl.VertxImpl$InternalTimerHandler.run(VertxImpl.java:883)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:176)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing automated-rule deletion and active-recording cleanup, using the PeriodicArchiver.java and RuleProcessor.java locations shown in the exception stack. Reproduce the case with two connect URLs resolving to one target, then verify that deleting the rule removes each active recording once without logging RecordingNotFoundException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.