fix(consul): support to fetch only health endpoint#9204
Conversation
|
@tokers @spacewander @tzssangglass Please take a look at this PR, thanks |
|
@liuxiran Could you return CI? some other test error, which is not I add |
|
@Fabriceli The ci has been reruned |
|
@monkeyDluffy6017 Please take a look at this PR, thanks |
|
@monkeyDluffy6017 The CI is not very stable,could you re-run the CI? |
…t_health_endpoint
|
ping @monkeyDluffy6017 @soulbird |
|
Hi @Fabriceli, thank you for all your hard work! |
leslie-tsang
left a comment
There was a problem hiding this comment.
Thanks for your contribution. :)
| if watch_error_info then | ||
| log.error("connect consul: ", consul_server.consul_server_url, | ||
| " by sub url: ", consul_server.consul_watch_health_url, | ||
| ", got watch result: ", json_delay_encode(watch_result, true), |
There was a problem hiding this comment.
| ", got watch result: ", json_delay_encode(watch_result, true), | |
| ", got watch result: ", json_delay_encode(watch_result, true), |
No need for json_delay_encode as the log level is error by default ?
There was a problem hiding this comment.
you are right, done
There was a problem hiding this comment.
| ", got watch result: ", json_delay_encode(watch_result, true), | |
| ", got watch result: ", json_encode(watch_result, true), |
Sry for the mistake, we can use json_encode instead of json_delay_encode here. WDYT ?
Description
Thank you for your previous work @dyrnq
Create TWO threads to watch the catalog services and health services:
flowchart TD subgraph Thread 1: watch catalog A[Start] --> catalog{Catalog any change?} catalog -->|Yes| cindex[return catalog index] catalog ---->|No| cblock[block query until catalog any change] cblock --> E[End] cindex --> E end subgraph Thread 2: watch health A2[Start] --> health2{health any change?} health2 -->|Yes| hindex[return health index] health2 ---->|No| hblock[block query until health any change] hblock --> E2[End] hindex --> E2 end subgraph Wait any thread A3[Start] --> spawn[Spawn TWO threads] spawn --> wait[wait any Thread] wait --> catalog2[Query all services] catalog2 --> H[Query health nodes] H --> update[Update all services] update --> e[End] endFixes # (issue)
Reference: #8856, #8928
Checklist