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]add wait_add_target_list to store the target #42

Closed
wants to merge 1 commit into from

Conversation

dabue
Copy link

@dabue dabue commented Apr 26, 2020

Add a wait_add_target_list to store the target before added to the target_list actually.
Using the function locking_target_list, the timer delays adding targets, so it will get an error if use the get_target_status function to get the status of a node before added.
use the wait_add_target_list to store target's default is_healthy status.

fix #43

@dabue
Copy link
Author

dabue commented Apr 27, 2020

At v1.2.0 , some errors got like:
[error] 46#46: 14188959 failed to run balancer_by_lua: /opt/app/test_proj/deps/share/lua/5.1/resty/healthcheck.lua:247: attempt to index field 'targets' (a nil value)
stack traceback:
/opt/app/test_proj/deps/share/lua/5.1/resty/healthcheck.lua:247: in function 'get_target'
/opt/app/test_proj/deps/share/lua/5.1/resty/healthcheck.lua:424: in function 'get_target_status'
/opt/app/test_proj/lua/ins_breaker/http/balancer.lua:334: in function 'load_balancer'
/opt/app/test_proj/lua/circuit_breaker.lua:259: in function 'http_balancer_phase'
balancer_by_lua:2: in main chunk while connecting to upstream, client: 10.23.178.7

@Tieske Tieske mentioned this pull request Sep 18, 2020
@Tieske
Copy link
Member

Tieske commented Sep 18, 2020

looks like the same issue as #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The targets is nil when call the function get_target after add target.
2 participants