Skip to content

ClassPath detection incomplete/non-deterministic when using parallel scans #614

@steveniemitz

Description

@steveniemitz

On version 4.8.138

If I construct a ClassGraph instance and have it scan the current classloader, eg:

new ClassGraph()
  .addClassLoader(classLoader)
  .scan()
  .getClasspathFiles()

The results change each time I run it and are generally incomplete (missing many entries). For example, I frequently will only get <50 entries back from a classpath of 800+ items.

If I simply change scan() to scan(1), the results are correct and deterministic. I do have logs for the incorrect and correct runs, but need to work on trying to sanitize them before I upload them here.

I suspect the problem might be that the root/only direct classpath entry is a classpath manifest jar. That then expands to a large (800+) jar classpath.

Any ideas what might be going on here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions