Skip to content

fix: ClassPathScanner — Filter to NeonBee module JARs only#731

Draft
ikalachy wants to merge 1 commit into
mainfrom
fix/read-only-neonbee
Draft

fix: ClassPathScanner — Filter to NeonBee module JARs only#731
ikalachy wants to merge 1 commit into
mainfrom
fix/read-only-neonbee

Conversation

@ikalachy

@ikalachy ikalachy commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

ClassPathScanner — Filter to NeonBee module JARs only

Overview

This change addresses a blocked thread issue in Kubernetes/Kyma environments where scanForAnnotation blocks a Vert.x worker thread for 87+ seconds reading all JARs on the classpath. The fix pre-filters JARs by checking their manifest for NeonBee-* attributes before doing the expensive filesystem walk.

Correctness

  • Reading a small MANIFEST.MF is cheaper than opening a FileSystem and walking an entire JAR.
  • Public API preserved. scanJarFilesWithPredicate(Vertx, Predicate) delegates with url -> true, so existing callers (including forJarFile) are unaffected.
  • One subtle issue: isNeonBeeJar reads the manifest via manifestUrl.openStream(), and then later in the loop, the same manifest URL is used to create a FileSystem. This means the manifest is read twice for NeonBee JARs (once in the filter, once when
    FileSystems.newFileSystem opens it). Not a correctness bug, but a minor inefficiency. Given the goal is to skip 100+ non-NeonBee JARs, the double-read of the few NeonBee JARs is negligible.

@ikalachy ikalachy force-pushed the fix/read-only-neonbee branch from 1c23add to f4b6e71 Compare June 8, 2026 08:29

@carlspring carlspring left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! :)

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.

2 participants