Skip to content

[Bug]: Hop GUI freezes while the background linter checks a pipeline that reads a large folder #9783

Description

@hansva

Apache Hop version?

2.20.0

Java version?

21

Operating system

macOS

What happened?

After opening a project, Hop GUI stops responding for minutes while one core stays busy. Clicks on the canvas open a context dialog that never paints, and the Explorer does not redraw.

How to reproduce

  1. Have a project with a pipeline whose Text file input reads a large local folder with Include subfolders set, for example a source checkout. In the case analysed here the folder held about 1.6 million files in 640k directories.
  2. Leave the linter on and open the project. The background lint pass checks every pipeline in it.
  3. Use the GUI while that pass runs: open a context dialog on the canvas, or expand folders in the Explorer.

Cause

Thread dumps show two threads fighting over the lock of the local VFS file system (HopLocalFileProvider$HopLocalFileSystem).

The background lint thread runs the native checks of each pipeline. TextFileInputMeta.check() builds the whole file list to report how many files it found, and that walk takes the file system's lock for every file and folder it visits:

"HopLinter-Background" RUNNABLE
  at java.io.File.exists
  at org.apache.commons.vfs2.provider.local.LocalFile.doGetType
  at org.apache.commons.vfs2.provider.AbstractFileObject.getType
  - locked <…> (a org.apache.hop.core.vfs.HopLocalFileProvider$HopLocalFileSystem)
  at org.apache.commons.vfs2.provider.AbstractFileObject.traverse   (× 9)
  at org.apache.commons.vfs2.provider.AbstractFileObject.findFiles
  at org.apache.hop.core.fileinput.FileInputList.createFileList
  at org.apache.hop.pipeline.transforms.file.BaseFileInputMeta.getFileInputList
  at org.apache.hop.pipeline.transforms.fileinput.text.TextFileInputMeta.check
  at org.apache.hop.pipeline.PipelineMeta.checkTransforms
  at org.apache.hop.lint.HopLinter.lintPipelineLikeVerify
  at org.apache.hop.lint.BackgroundLintService.lintFileForGui

The UI thread repaints the lint marks in the Explorer. For every Explorer item, LintStatusFilePainter.lookupCachedStatus() and resolveStatusFromResults() compare the item's path to every key of the status cache and of the results, using LintPathUtils.pathsMatch(). pathsMatch() normalizes both paths through HopVfs.getFileObject(), and each call resolves a file object, which needs that same lock. It also holds the HopVfs class monitor while it waits, since getFileObject(String) is static synchronized.

"main" BLOCKED (on object monitor)
  at org.apache.commons.vfs2.provider.AbstractFileSystem.resolveFile
  - waiting to lock <…> (a org.apache.hop.core.vfs.HopLocalFileProvider$HopLocalFileSystem)
  at org.apache.hop.core.vfs.HopVfs.getFileObject
  - locked <…> (a java.lang.Class for org.apache.hop.core.vfs.HopVfs)
  at org.apache.hop.lint.LintPathUtils.normalizePath
  at org.apache.hop.lint.LintPathUtils.pathsMatch
  at org.apache.hop.lint.LintStatusFilePainter.lookupCachedStatus
  at org.apache.hop.lint.LintStatusFilePainter.resolveStatus
  at org.apache.hop.lint.LintStatusFilePainter.reapply
  at org.apache.hop.lint.LintStatusFilePainter.repaintExplorerIcons
  at org.eclipse.swt.widgets.Display.runAsyncMessages
  at org.apache.hop.ui.core.dialog.ContextDialog.open

The work on the UI thread grows with the number of Explorer items times the number of cache entries. With 470 pipelines and workflows, one repaint costs about 2 × 470 × 940 ≈ 880,000 file resolves. Each one waits for a lock the walk takes over a million times. The comparisons were never needed: both caches are already keyed by normalized paths, and the item's path is normalized when the Explorer paints it.

This has been there since the linter was added (#8199).

Fix

  • LintPathUtils.normalizedPathsMatch(a, b) compares two paths that are already normalized as plain strings, ignoring case, without resolving anything. pathsMatch() normalizes both sides and then calls it, so it behaves as before.
  • LintStatusFilePainter.lookupCachedStatus() and resolveStatusFromResults() use normalizedPathsMatch() against the cache keys.
  • LintStatusFilePainter.resolveStatus() no longer normalizes the item's path again. Its callers pass the path from resolveExplorerFilePath(), which is already normalized.

Repainting the Explorer now does no VFS work on the UI thread. Lint results and marks are unchanged.

Tests: LintPathUtilsTest covers normalizedPathsMatch(), including case, empty input, and a file:// URI that only matches once it is normalized.

Not covered here

  • The background pass still runs every transform's native check on every project file. Some of those checks do real I/O. Text file input walks folders and database transforms connect, so a large folder still costs a core, plenty of heap and minutes of disk work, just without freezing the GUI. Whether the project-wide pass should run native checks at all, or only lint policy rules, needs its own issue.
  • FileInputList.createFileList() walks the same folder once for every file entry that names it. Three masks on one folder means three full walks.
  • LintResultsManager still compares paths through pathsMatch() while it holds its own lock, and the Explorer lookup waits for that lock. If an open editor's lint result is published in the middle of a large walk, the UI can still wait on it, though far less often than before.

Issue Priority

Priority: 2

Issue Component

Component: Hop Gui

Activity

  1. added theissue type on Nov 28, 2026
  2. hansva commented on Nov 28, 2026

    @hansva
    ContributorAuthor

    .take-issue

  3. added this to the 2.21 milestone on Nov 28, 2026
  4. added a commit that references this issue on Nov 29, 2026
    f799388
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Hop GuiP2

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions