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

contrib/registry/file: registry file was deleted when multiple services registered #3709

Open
songjianzhong opened this issue Jul 26, 2024 · 4 comments
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. need more details

Comments

@songjianzhong
Copy link

Go version

go 1.21

GoFrame version

v2.7.2

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

多个服务共用一个目录注册时,file_discovery.go第97行执行gfile.Remove(filePath),会误删其他服务的注册文件,导致服务使用异常。

What did you see happen?

当多个服务共用一个目录注册时,file_discovery.go第97行执行gfile.Remove(filePath),会误删其他服务的注册文件,导致服务使用异常。

What did you expect to see?

file_discovery.go第97行不能执行gfile.Remove(filePath)。建议将_ = gfile.Remove(filePath)这行删除。

@songjianzhong songjianzhong added the bug It is confirmed a bug, but don't worry, we'll handle it. label Jul 26, 2024
@gqcn
Copy link
Member

gqcn commented Sep 12, 2024

@songjianzhong 这里不能直接删除,因为服务其实有心跳逻辑会更新文件中的更新时间,可能更新时间没有得到及时更新导致的。建议debug一下流程,看看是不是在file 没有及时更新时间。如果是可以提个一个pr来修复。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@songjianzhong It cannot be deleted directly because the service actually has heartbeat logic to update the update time in the file. It may be that the update time is not updated in time. It is recommended to debug the process to see if file does not update the time in time. If so, you can submit a PR to fix it.

@gqcn gqcn changed the title github.com/gogf/gf/contrib/registry/file/[email protected]: issue file_discovery.go第97行不要执行gfile.Remove(filePath) contrib/registry/file: registry file was deleted when multiple services registered Sep 12, 2024
@gqcn
Copy link
Member

gqcn commented Sep 30, 2024

@songjianzhong 请提供可复现该问题的最小可运行代码。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@songjianzhong Please provide the smallest runnable code that can reproduce the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. need more details
Projects
None yet
Development

No branches or pull requests

3 participants