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

[BugFix] should acquire db lock out of createLoadTask to avoid dead lock (backport #55219) #55264

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 20, 2025

Why I'm doing:

A dead lock issue is found:

Slow lock:
image

Thread "pool-21-thread-406" owns the database lock.
StreamLoadMgr.cleanSyncStreamLoadTasks() tries to acquire StreamLoadMgr.lock.writeLock() 0x00007fb9905311a8

Jstack:
image

Thread "thrift-server-pool-6208" owns the StreamLoadMgr.lock.writeLock(): 0x00007fb9905311a8 in StreamLoadMgr.beginLoadTask()

StreamLoadMgr.beginLoadTask() call StreamLoadMgr.createLoadTask() who is trying to acquire database lock

What I'm doing:

StreamLoadMgr.createLoadTask() don't acquire database lock.
StreamLoadMgr.beginLoadTask() first acquire database lock and unlock, then acquire StreamLoadMgr.lock.writeLock()

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

…ock (#55219)

Signed-off-by: kaijian.ding <[email protected]>
(cherry picked from commit 9af1024)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/load/streamload/StreamLoadMgr.java
@mergify mergify bot added the conflicts label Jan 20, 2025
Copy link
Contributor Author

mergify bot commented Jan 20, 2025

Cherry-pick of 9af1024 has failed:

On branch mergify/bp/branch-3.3/pr-55219
Your branch is up to date with 'origin/branch-3.3'.

You are currently cherry-picking commit 9af1024b99.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   fe/fe-core/src/main/java/com/starrocks/load/routineload/RoutineLoadJob.java

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/main/java/com/starrocks/load/streamload/StreamLoadMgr.java

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Copy link
Contributor Author

mergify bot commented Jan 20, 2025

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

@mergify mergify bot closed this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant