Skip to content

Refactor/network improvements

Georgy Moshkin requested to merge refactor/network-improvements into master

Summary

  • Rename trait rpc::Request to RequestArgs to be more specific and to reduce the number of structs named Request
  • Add network::Request (private) struct instead of an unnamed tuple for the request queue in the ConnectionPoolWorker
  • Remove ConnectionPoolBuilder struct to reduce code complexity. Builders should also be added in cases their use is a benefit, i.e. large numbers of parameters, sequences of parameters, etc. This is not the case with ConnectionPool
  • Make connection pool's methods take &self by hiding the mutability internally using the UnsafeCell. This is safe, because 2 raw pointers into the UnsafeCell will never exist simultaneously, unless we use ConnectionPool from separate threads, which we aren't going to.
  • Refactor ConnectionPool's code to reduce copy-paste
  • Add ability to specify a timeout per request. If the timeout is not specified, the one from the WorkerOptions is used.
  • Reuse the single ConnectionPool between raft node loop and governor loop

Ensure that

  • New code is covered by tests
  • API is documented
  • Changelog is up to date
  • (if Lua API changed) Lua API version is bumped in luamod.rs
  • (if API docs changed) A follow-up doc issue is created in picodata/docs and linked here
Edited by Yaroslav Dynnikov

Merge request reports