Skip to content

v0.14.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@AndreasAakesson AndreasAakesson released this 24 Jan 09:56
· 1451 commits to master since this release
0efba18

We’ve experienced issues with running out of memory due to lack of a way to limit speed/memory consumption in TCP. This happened when using our load balancer on links with different speed. This release mainly consists of fixes to this issue (and other issues found along the way).

What’s new:

  • Our own implementation of std::memory_resource to be used with the C++17 concept polymorphic_allocator
    • Pmr_pool and Pmr_resource keep track and limits the amount of bytes an allocator can allocate.
    • The implementation is very flexible and let us improve and make a more sophisticated memory solution down the road
  • Changed our byte vector used around the OS (mainly TCP) to use polmorphic_allocator
    • using buffer = std::pmr::vector<uint8_t>
  • Each TCP stack now have its own assigned memory pool (Pmr_pool), and each TCP connection now gets assigned its own resource (Pmr_resource)
    • Assigning memory to a TCP stack is done with set_total_bufsize(const size_t size) (default is set to 64MB)
  • TCP connection no longer reports a static receive window, but instead a dynamic one based on how much memory used up in its resource
    • This helps throttling the connection when buffers aren’t released quickly enough, and avoids buffering more than the memory limit
  • Added new on_data() callback to TCP connection with support functions read_next() and next_size()
    • Triggered every time new data is ready to be read (use read_next() on connection to retrieve)
    • Solves the issue of buffering having to be implemented on top - this is now done in the connection
    • Use either on_read or on_data depending on use case - as today, on_read has priority over on_data
    • The same functions are now also exposed in the net::Stream interface
  • New TLS stream implementation and stream buffer class
    • Now utilizes the on_data() callback instead of on_read
    • Manages congestion and memory allocations for encryption better
  • Various fixes and improvements in TCP
  • MicroLB hardening, improvements and fixes