Skip to content

Configure loader timeout and fix plugin component display#478

Merged
DropSnorz merged 3 commits into
masterfrom
feat/loader-timeout
May 23, 2026
Merged

Configure loader timeout and fix plugin component display#478
DropSnorz merged 3 commits into
masterfrom
feat/loader-timeout

Conversation

@DropSnorz
Copy link
Copy Markdown
Owner

@DropSnorz DropSnorz commented May 23, 2026

Resolves #477

Content

  • Native loader timeout can be configured from the Options pane
  • Errors during plugin native scan are reported in the plugin view
  • Fixed a thread leak issue preventing the app from exiting correctly after a scan
  • Fixed plugin component filtering from the tree and flat list view
  • Plugin components are now correctly displayed in the table view

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

Review Change Stack

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 672f0704-9586-4911-bd6b-70ea64e8957e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/loader-timeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DropSnorz DropSnorz changed the title Configure loader timeout and fix component display Configure loader timeout and fix plugin component display May 23, 2026
@DropSnorz
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java`:
- Around line 175-188: The loaderTimeoutTextField listener currently accepts any
parsed long and persists it, which can overflow when converted to milliseconds
downstream; update the listener in OptionsController so that after parsing the
newValue you validate it against a safe maximum (e.g., define a
MAX_LOADER_TIMEOUT_SECONDS constant) or ensure timeout <= Long.MAX_VALUE / 1000
before persisting and calling nativeHostService.setScannerTimeout; if the value
is out of range, either clamp to the max or ignore the input and do not call
getPreferences().putLong(ApplicationDefaults.NATIVE_LOADER_TIMEOUT_KEY, ...) nor
nativeHostService.setScannerTimeout(...). Also consider using Math.multiplyExact
or an overflow-safe check when any code converts seconds to milliseconds.
- Around line 317-318: Replace the hardcoded 30L fallback with the canonical
default constant from ApplicationDefaults so the UI uses the same startup
default used when preferences are initialized: change the call using
getPreferences().getLong(ApplicationDefaults.NATIVE_LOADER_TIMEOUT_KEY, 30L) to
pass the ApplicationDefaults default constant (the associated timeout default
defined in ApplicationDefaults) instead of 30L so loaderTimeoutTextField shows
the same initial value as preference initialization.

In
`@owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginInfoController.java`:
- Around line 204-209: The code only updates lastScanErrorLabel when
plugin.getFootprint() is non-null, leaving stale error text visible when the
footprint is absent; modify the if block around plugin.getFootprint() (the
section that sets nativeDiscoveryToggleButton, scanError, and
lastScanErrorLabel) to add an else branch that clears and hides
lastScanErrorLabel (e.g., setText("") and setVisible(false)) and also ensure
nativeDiscoveryToggleButton is set to a safe default in that else to avoid stale
state.

In
`@owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginTableController.java`:
- Around line 210-214: The selection loop in selectPluginById compares
IPlugin.getId() across heterogeneous entities (Plugin and PluginComponent),
causing cross-entity collisions; restrict the check to actual Plugin instances
and use a consistent primitive comparison: inside selectPluginById iterate
pluginList, first ensure the item is a Plugin (e.g., if (plugin instanceof
Plugin) { Plugin p = (Plugin) plugin; if (p.getId() == id) {
tableView.getSelectionModel().select(p); break; } }), or if getId() returns Long
use Long.valueOf(id).equals(p.getId()) after the instanceof check; this
guarantees you only match Plugin entities and avoids ID type mismatches.

In
`@owlplug-client/src/main/java/com/owlplug/plugin/services/NativeHostService.java`:
- Around line 56-57: Centralize validation and seconds→milliseconds conversion
by adding a setScannerTimeout(long seconds) method (or updating the existing
one) that: checks for negative input and clamps to a safe minimum (e.g., 0 or a
default), computes milliseconds using a checked multiply to avoid overflow
(e.g., guard seconds > Long.MAX_VALUE/1000 and cap to Long.MAX_VALUE or
Long.MAX_VALUE/1000*1000), and then calls
EmbeddedScannerPluginLoader.getInstance().setTimeout(milliseconds); then replace
direct multiplications in init() (the call setting timeoutSeconds * 1000) and
the other site around lines 116-118 to call setScannerTimeout(timeoutSeconds) so
all conversion and validation is centralized in that method.

In `@owlplug-host/src/main/java/com/owlplug/host/io/CommandRunner.java`:
- Around line 78-80: In the InterruptedException catch in CommandRunner (catch
block that currently throws new IOException("Process execution interrupted", e))
restore the thread's interrupt status before throwing by calling
Thread.currentThread().interrupt(), then re-throw the IOException; apply the
same change in PlatformUtils where InterruptedException is caught (the catch
at/around the existing throw on line ~80) so cooperative cancellation isn't
swallowed—i.e., call Thread.currentThread().interrupt() immediately inside each
InterruptedException handler, then throw the IOException as before.

In
`@owlplug-host/src/main/java/com/owlplug/host/loaders/EmbeddedScannerPluginLoader.java`:
- Around line 133-138: The current exit-code check in
EmbeddedScannerPluginLoader treats any non-negative exit value as success;
update the condition that checks result.getExitValue() in the method that calls
createPluginsFromCommandOutput(...) so it only treats 0 as success (use
result.getExitValue() == 0) and throw NativeLoaderException for any non-zero
exit code, ensuring failing scanner exits do not proceed to XML extraction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 33372e5c-232b-48b6-8163-871aaaab5a44

📥 Commits

Reviewing files that changed from the base of the PR and between 4809572 and 2cd8fe1.

📒 Files selected for processing (20)
  • owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java
  • owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java
  • owlplug-client/src/main/java/com/owlplug/core/services/OptionsService.java
  • owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginInfoController.java
  • owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginTableController.java
  • owlplug-client/src/main/java/com/owlplug/plugin/controllers/PluginTreeViewController.java
  • owlplug-client/src/main/java/com/owlplug/plugin/model/IPlugin.java
  • owlplug-client/src/main/java/com/owlplug/plugin/model/Plugin.java
  • owlplug-client/src/main/java/com/owlplug/plugin/model/PluginComponent.java
  • owlplug-client/src/main/java/com/owlplug/plugin/model/PluginFootprint.java
  • owlplug-client/src/main/java/com/owlplug/plugin/services/NativeHostService.java
  • owlplug-client/src/main/java/com/owlplug/plugin/tasks/PluginScanTask.java
  • owlplug-client/src/main/resources/fxml/OptionsView.fxml
  • owlplug-client/src/main/resources/fxml/plugins/PluginInfoView.fxml
  • owlplug-host/src/main/java/com/owlplug/host/io/CommandRunner.java
  • owlplug-host/src/main/java/com/owlplug/host/loaders/DummyPluginLoader.java
  • owlplug-host/src/main/java/com/owlplug/host/loaders/EmbeddedScannerPluginLoader.java
  • owlplug-host/src/main/java/com/owlplug/host/loaders/NativeLoaderException.java
  • owlplug-host/src/main/java/com/owlplug/host/loaders/NativePluginLoader.java
  • owlplug-host/src/main/java/com/owlplug/host/loaders/jni/JNINativePluginLoader.java

Comment thread owlplug-client/src/main/java/com/owlplug/core/controllers/OptionsController.java Outdated
Comment thread owlplug-host/src/main/java/com/owlplug/host/io/CommandRunner.java
@DropSnorz DropSnorz force-pushed the feat/loader-timeout branch from 2cd8fe1 to 0e7357e Compare May 23, 2026 14:35
Repository owner deleted a comment from coderabbitai Bot May 23, 2026
@DropSnorz DropSnorz self-assigned this May 23, 2026
@DropSnorz DropSnorz added this to the 1.33.1 milestone May 23, 2026
@DropSnorz DropSnorz merged commit 8134cea into master May 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Owlplug scanner timeout should be configurable

1 participant