-
Notifications
You must be signed in to change notification settings - Fork 229
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
feat: add check rules to avoid cycle Ref #556
Comments
Oh great find! Yeah, we should either detect and disallow cycles or allow cycles. We'll work on this. |
Oh great find! Yeah, we should either detect and disallow cycles or allow cycles. We'll work on this. |
@mwhittaker Can you help to understand more about for me fix that? |
@renanbastos93 |
Looks great!
Would you mind sending a PR to add this support in the main Service Weaver
repo as well?
Thanks,
- Robert
…On Wed, May 29, 2024 at 11:44 PM 大可 ***@***.***> wrote:
@renanbastos93 <https://github.com/renanbastos93>
I fixed this problem by checking the cycle at runtime, details can be
found in the link below, just for your information :-)
https://github.com/go-kod/kod/blob/main/registry.go#L168
—
Reply to this email directly, view it on GitHub
<#556 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMZ5KTKHZ4XC5HNRAQHFKTZE3DDVAVCNFSM6AAAAAA32WPL5KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZYG44TIMZTGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: <ServiceWeaver/weaver/issues/556/2138794335 ***@***.***
com>
|
Awesome, @sysulq Would you like to open a PR to fix that? |
@rgrandl @renanbastos93 Sure, but I've been a bit busy lately, so I would get to it after some time. 🙂 |
@sysulq I can help you maybe I could to open PR and you review it. What do you think? |
@renanbastos93 Definitely sure |
I've already opened my branch to implement it, but now I am understanding more details about the code generation and the registry component needed to code it. If there is any other important information, please share it with me. |
https://github.com/renanbastos93/weaver-issue-556 (this project simulate the bug) |
@mwhittaker I have been thinking about raising an error when there is a cyclic reference. Maybe we could change this approach to accept it. Have you ever thought about accepting cyclic references? I'll continue fixing it based on raising an error when avoiding cyclic references, but I'd like to bring this point up for reflection. I know that Golang can't import packages with cyclic references, but maybe we could think about that. |
When we change the examples/chat below, it's not hard to realise localCache and scaler are mutually dependent, which would lead to a stack overflow.
The text was updated successfully, but these errors were encountered: