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

[BUG] divide plugin config lost when network has problem #5311

Closed
1 task done
NightliarX opened this issue Nov 21, 2023 · 4 comments · Fixed by #5587
Closed
1 task done

[BUG] divide plugin config lost when network has problem #5311

NightliarX opened this issue Nov 21, 2023 · 4 comments · Fixed by #5587
Assignees
Labels
admin type: bug Something isn't working

Comments

@NightliarX
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

when the network experiences jitter,the ip:port configuration in divide plugin will be lost

Expected Behavior

do not change divide plugin's configuration even the network is unreachable,because network jitter will recover soon

Steps To Reproduce

1.click pluginList-proxy-divide-add,to add a new divide config
2,in this config,Ip:port set a Ip address that unreachable
3.save this config
4.click modify button to see Ip:port config

Environment

ShenYu version(s):2.5.1

Debug logs

No response

Anything else?

No response

@NightliarX NightliarX added the type: bug Something isn't working label Nov 21, 2023
@NightliarX
Copy link
Author

Screenshot 2023-11-21 185629 Screenshot 2023-11-21 185815
after reading the code ,I found that the code in org.apache.shenyu.admin.service.impl.UpstreamCheckService may have concurrency problem.
UPSTREAM_MAP.get(selectorId) in first picture may execute before updateHandler in method submit was executed.it leads to an error result after updated the database(updateHandler's update result in first picture will cover the update result in second picture)

@NightliarX
Copy link
Author

NightliarX commented Nov 21, 2023

and I dont understand why shenyu-admin would update database after the network changes,I dont think it is a good design.shenyu-admin can do this operation and publish event in memory,but update datebase makes me very confusing and it occures problem

I losed almost all ip:port in divide configs after the jitter and it cannot recover automaticaly because of this bug,that's a very serious problem.

@moremind
Copy link
Member

yeah, shenyu will refactor the design, and keep the database, now, you can config shenyu.register.props.checked=false

@moremind moremind added the admin label Nov 28, 2023
@loongs-zhang loongs-zhang self-assigned this Jul 3, 2024
loongs-zhang added a commit to loongs-zhang/shenyu that referenced this issue Jul 3, 2024
@loongs-zhang
Copy link
Member

@NightliarX Hi, I recommend increasing the value of shenyu.register.props.zombieCheckTimes.

As for concurrency problem, see #5587 , the PR also fix other bug.

loongs-zhang added a commit that referenced this issue Jul 6, 2024
* [ISSUE #5311] less concurrency

* fix grpc CI

* try fix grpc e2e CI

* rollback

---------

Co-authored-by: moremind <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants