Skip to content

#14230 Fix deadlock when importing wells from OSDU#14232

Open
kriben wants to merge 1 commit into
devfrom
14230-fix-osdu-import-deadlock
Open

#14230 Fix deadlock when importing wells from OSDU#14232
kriben wants to merge 1 commit into
devfrom
14230-fix-osdu-import-deadlock

Conversation

@kriben

@kriben kriben commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

The GUI thread deadlocked on a non-recursive QMutex during OSDU well import. The download-completion slots and DataLoadController::onTaskFinished held a mutex while triggering progress updates, which call QApplication::processEvents(). That re-enters the event loop and dispatches another queued parquet-download-complete event for a different well, whose handler then blocks trying to lock the same mutex.

Release the mutex before emitting taskDone in the OSDU well path and well log data loaders, and before calling incrementProgress() in onTaskFinished. The map access that the mutex protects stays inside the locked scope; the captured ProgressInfo outlives the call (kept alive by blockUntilDone) and incrementProgress() is thread-safe via self-marshaling to the GUI thread.

Fixes #14230.

@kriben kriben marked this pull request as ready for review June 17, 2026 10:52
@jonjenssen

Copy link
Copy Markdown
Collaborator

Could use scoping to have the lock go out of scope before sending

@magnesj magnesj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As Jon suggested, move lock into scope to avoid calling unlock

The GUI thread deadlocked on a non-recursive QMutex during OSDU well
import. The download-completion slots and DataLoadController::onTaskFinished
held a mutex while triggering progress updates, which call
QApplication::processEvents(). That re-enters the event loop and dispatches
another queued parquet-download-complete event for a different well, whose
handler then blocks trying to lock the same mutex.

Release the mutex before emitting taskDone in the OSDU well path and well
log data loaders, and before calling incrementProgress() in onTaskFinished.
The map access that the mutex protects stays inside the locked scope; the
captured ProgressInfo outlives the call (kept alive by blockUntilDone) and
incrementProgress() is thread-safe via self-marshaling to the GUI thread.

Fixes #14230.
@kriben kriben force-pushed the 14230-fix-osdu-import-deadlock branch from 5489676 to 7e87731 Compare June 17, 2026 12:12
@kriben kriben requested a review from magnesj June 17, 2026 13:14
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.

OSDU wells: Freeze when importing Norne wells

3 participants