[PR #2408] fix recreating users' default tenant relations when loading user #23625

Closed
opened 2026-02-21 20:21:27 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/2408

State: closed
Merged: Yes


  • fix bugs in load_user introduced by Add Usage Information Output to LLM Node in Workflow (#2341)
    1. skip auto creating default tenant in this method. for the reasons that
    • 1.1 it causes leak as it does not acquire locks to guarantee only one default tenant will be created
    • 1.2 it's not a right timing to create user's default tenant. A better way is to do it in register service.
    1. reuse existed available tenant for the user

Caused by 1.2.
image

**Original Pull Request:** https://github.com/langgenius/dify/pull/2408 **State:** closed **Merged:** Yes --- - fix bugs in `load_user` introduced by #2341 - 1. skip auto creating default tenant in this method. for the reasons that - 1.1 it causes leak as it does not acquire locks to guarantee only one default tenant will be created - 1.2 it's not a right timing to create user's default tenant. A better way is to do it in register service. - 2. reuse existed available tenant for the user Caused by 1.2. <img width="480" alt="image" src="https://github.com/langgenius/dify/assets/1935105/f3acbf41-49d0-4fad-8163-72a2551a820f">
yindo added the pull-request label 2026-02-21 20:21:27 -05:00
yindo closed this issue 2026-02-21 20:21:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#23625