liushiqi1001 opened a new pull request, #2919:
URL: https://github.com/apache/dubbo-go/pull/2919

   ## Description
   Fix a critical bug in `TryRefreshBlackList` function where it would check 
the availability of invoker at index `j` but incorrectly remove the invoker at 
index `i`.
   
   ## Problem
   - **File**: `protocol/base/rpc_status.go` line 269
   - **Issue**: `RemoveInvokerUnhealthyStatus(ivks[i])` uses wrong index
   - Logic checks `ivks[j].IsAvailable()` but removes `ivks[i]` 
   - This caused wrong invokers to be removed from blacklist
   - Led to frequent incorrect blacklist operations
   - Resulted in excessive logging like:
     ```
     INFO protocol/rpc_status.go:214 Add invoker ip = 10.100.131.252:20880 to 
black list
     INFO protocol/rpc_status.go:221 Remove invoker ip = 10.100.131.252:20880 
from black list
     ```
   
   ## Solution
   **One line fix**: `RemoveInvokerUnhealthyStatus(ivks[i])` → 
`RemoveInvokerUnhealthyStatus(ivks[j])`
   
   ## Changes
   ```diff
   for j := range ivks {
       if j%3-i == 0 && ivks[j].IsAvailable() {
   -       RemoveInvokerUnhealthyStatus(ivks[i])  // Wrong: removes invoker at 
index i
   +       RemoveInvokerUnhealthyStatus(ivks[j])  // Correct: removes invoker 
at index j
       }
   }
   ```
   
   ## Testing
   - [x] Based on latest develop branch
   - [x] Minimal change with maximum impact
   - [x] Logic now correctly removes the invoker that was actually checked
   
   ## Impact
   This fix eliminates the frequent incorrect blacklist operations and ensures 
the blacklist refresh mechanism works as intended.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to