hanzhe-one opened a new pull request, #208:
URL: https://github.com/apache/dubbo-rust/pull/208
## What this PR does
Fixes both bugs reported in #206.
### 1. TLS conditional always true (`dubbo/src/triple/transport/service.rs`)
```rust
if self.certs.len() != 0 && !self.keys.len() != 0 {
```
`!self.keys.len() != 0` parses as `(!self.keys.len()) != 0`. `!` is
bitwise-not on a `usize`, so the expression is always `true`. When certs are
present but `keys` is empty this reaches `keys.remove(0)` and panics. Removed
the stray `!` so the guard matches the correct form already used in
`server/builder.rs`.
### 2. Wrong map queried in `diff()` (`registry/zookeeper/src/lib.rs`)
The second loop iterated `old_urls_map` and then looked the key up in
`old_urls_map` again, so `new_host` was always `Some` and `removed_hosts` never
collected nodes that had gone offline. Consumers kept routing to "zombie"
providers after shutdown. Changed the lookup to `new_urls_map`.
## Testing
- `cargo build -p dubbo -p dubbo-registry-zookeeper` passes.
- `cargo +nightly fmt --check` passes.
--
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]