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

DSS: There is something strange about the tests in kvraft (lab3). #426

Open
makisevon opened this issue Jun 15, 2022 · 0 comments
Open

DSS: There is something strange about the tests in kvraft (lab3). #426

makisevon opened this issue Jun 15, 2022 · 0 comments
Labels
type/bug Something isn't working

Comments

@makisevon
Copy link

makisevon commented Jun 15, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

In client.rs, we will see

pub fn get(&self, key: String) -> String { /* snip */ }
pub fn put(&self, key: String, value: String) { /* snip */ }
pub fn append(&self, key: String, value: String) { /* snip */ }

These public methods are not async, but they have to call some async RPCs. I try to solve this with futures::executor::block_on, now the methods will block until success even if the servers are down.

2. What did you expect to see?

Pass all the tests in kvraft.

3. What did you see instead?

In test_one_partition_3a:

cfg.net.spawn(future::lazy(move |_| {
    ckp2a.put("1".to_owned(), "15".to_owned());
    // snip
}));

// snip

cfg.net.spawn(future::lazy(move |_| {
    // different clerk in p2
    ckp2b.get("1".to_owned());
    // snip
}));

Run executor::block_on (LocalPool) from within cfg.net.spawn (ThreadPool) will panic with EnterError. Maybe we can solve this with something else, but the limitation is too inconvenient.

In generic_test_linearizability:

let operations = Arc::new(Mutex::new(vec![]));

// Clone the `operations`, move to `async` block, and call the methods.
// Shut down the servers and tell the clients to quit.

if !check_operations_timeout(
    KvModel {},
    Arc::try_unwrap(operations).unwrap().into_inner().unwrap(),
    LINEARIZABILITY_CHECK_TIMEOUT,
) {
    panic!("history is not linearizable");
}

Since the methods must succeed, they have to retry calling RPCs. So we cannot tell the clients to quit via shutting down the servers, and the Arc::try_unwrap may return Err and lead to panic.

@makisevon makisevon added the type/bug Something isn't working label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant