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

about AddPullCB size check #167

Open
jasperzhong opened this issue Feb 5, 2020 · 0 comments · May be fixed by #168
Open

about AddPullCB size check #167

jasperzhong opened this issue Feb 5, 2020 · 0 comments · May be fixed by #168

Comments

@jasperzhong
Copy link

jasperzhong commented Feb 5, 2020

https://github.com/dmlc/ps-lite/blob/master/include/ps/kv_app.h#L689

template <typename Val>
template <typename C, typename D>
int KVWorker<Val>::AddPullCB(
    const SArray<Key>& keys, C* vals, D* lens, int cmd,
    const Callback& cb) {
  int ts = obj_->NewRequest(kServerGroup);
  AddCallback(ts, [this, ts, keys, vals, lens, cb]() mutable {
      ...
  
      if (vals->empty()) {
        vals->resize(total_val);
      } else {
        CHECK_EQ(vals->size(), total_val);    // here
      }
     ...
    });

  return ts;
}

IMO, vals is the buffer to store pull results. So it does not have to be equal to total_val. Greater size should also be allowed. So I propose changing to CHECK_GE(vals->size(), total_val);.

@jasperzhong jasperzhong linked a pull request Feb 5, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant