Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a deadlock with local COPC files in 2D rendering #56432

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

wonder-sk
Copy link
Member

Follow up of #56388

It was possible to trigger a deadlock when using a local COPC file by zooming in/out while there was 2D rendering happening - this caused a situation where point cloud index was trying to recursively lock a mutex that the same thread has already locked.

fetchNodeHierarchy() for local COPC files now unlocks the mutex before calling fetchHierarchyPage() just like what happens with remote COPC files.

While fixing that, I have removed now duplicate code between the local and remote COPC support. The logic for dealing with hierarchy mutex should be clearer now as well - we do not call other functions of the index with mutex locked.

Follow up of qgis#56388

It was possible to trigger a deadlock when using a local COPC file
by zooming in/out while there was 2D rendering happening - this caused
a situation where point cloud index was trying to recursively lock
a mutex that the same thread has already locked.

fetchNodeHierarchy() for local COPC files now unlocks the mutex before
calling fetchHierarchyPage() just like what happens with remote COPC files.

While fixing that, I have removed now duplicate code between the local and
remote COPC support. The logic for dealing with hierarchy mutex should
be clearer now as well - we do not call other functions of the index
with mutex locked.
@wonder-sk wonder-sk added Bug Either a bug report, or a bug fix. Let's hope for the latter! Point Clouds backport release-3_34 labels Feb 20, 2024
@github-actions github-actions bot added this to the 3.36.0 milestone Feb 20, 2024
Copy link

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit e5ce4c5)

@wonder-sk wonder-sk enabled auto-merge (rebase) February 21, 2024 00:30
@nyalldawson nyalldawson merged commit 13446ee into qgis:master Feb 21, 2024
39 of 41 checks passed
@qgis-bot
Copy link
Collaborator

The backport to release-3_34 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply e5ce4c54aeb... Fix a deadlock with local COPC files in 2D rendering
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

stdout
Auto-merging src/core/pointcloud/qgscopcpointcloudindex.cpp
Auto-merging src/core/pointcloud/qgscopcpointcloudindex.h
Auto-merging src/core/pointcloud/qgsremotecopcpointcloudindex.cpp
CONFLICT (content): Merge conflict in src/core/pointcloud/qgsremotecopcpointcloudindex.cpp
Auto-merging src/core/pointcloud/qgsremotecopcpointcloudindex.h
CONFLICT (content): Merge conflict in src/core/pointcloud/qgsremotecopcpointcloudindex.h

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_34 release-3_34
# Navigate to the new working tree
cd .worktrees/backport-release-3_34
# Create a new branch
git switch --create backport-56432-to-release-3_34
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick e5ce4c54aeb3cfc83a23c0c33e26ceaf74ff654c
# Push it to GitHub
git push --set-upstream origin backport-56432-to-release-3_34
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_34

Then, create a pull request where the base branch is release-3_34 and the compare/head branch is backport-56432-to-release-3_34.

@qgis-bot qgis-bot added the failed backport The automated backport attempt failed, needs a manual backport label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3_34 Bug Either a bug report, or a bug fix. Let's hope for the latter! failed backport The automated backport attempt failed, needs a manual backport Point Clouds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants