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

Add an examples that demonstrates p2c rr behavior #39

Merged
merged 3 commits into from
Jan 25, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions tower-balance/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ where
debug!("promoting to ready: {}", n);
// Iterate through the not-ready endpoints from right to left to prevent removals
// from reordering services in a way that could prevent a service from being polled.
for offset in 1..n {
let idx = n - offset;

for idx in (0..n-1).rev() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olix0r I don't think this change is correct --- I stopped seeing the integer overflow in Conduit tests when building with this branch as of commit fb08434, but after pointing back at master as of 777888d, I'm getting the overflow again:

running 3 tests
test outbound_times_out ... ignored
thread 'support proxy' panicked at 'thread 'attempt to subtract with overflowsupport proxy', ' panicked at '/Users/eliza/.cargo/git/checkouts/tower-b098c32cf5a1bcca/777888d/tower-balance/src/lib.rsattempt to subtract with overflow:', 154/Users/eliza/.cargo/git/checkouts/tower-b098c32cf5a1bcca/777888d/tower-balance/src/lib.rs::24154
:note: Run with `RUST_BACKTRACE=1` for a backtrace.
24
test outbound_reconnects_if_controller_stream_ends ... FAILED
test outbound_asks_controller_api ... FAILED

failures:

---- outbound_reconnects_if_controller_stream_ends stdout ----
	thread 'outbound_reconnects_if_controller_stream_ends' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Inner(Error { kind: Io(Error { repr: Kind(BrokenPipe) }) }) }', src/libcore/result.rs:906:4

---- outbound_asks_controller_api stdout ----
	thread 'outbound_asks_controller_api' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Inner(Error { kind: Io(Error { repr: Kind(BrokenPipe) }) }) }', src/libcore/result.rs:906:4


failures:
    outbound_asks_controller_api
    outbound_reconnects_if_controller_stream_ends

test result: FAILED. 0 passed; 2 failed; 1 ignored; 0 measured; 0 filtered out

let is_ready = {
let (_, svc) = self.not_ready
.get_index_mut(idx)
Expand Down