You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The relay was the first SANS-IO component written for firezone. With the experience on snownet, I am no longer convinced that it was written in a very good way. In particular, bugs like #4094 are a result of some of its design choices.
To alleviate future bugs and make maintenance easier, we should rewrite relay::Server to an API similar to snownet:
Introduce a dedicated poll_transmit for sending messages
Introduce a dedicated poll_timeout for when we want to be woken next
Introduce a dedicated handle_timeout for performing time-based actions
In the current design, the above are combined into Commands. This can lead to subtle bugs where something needs to be performed at a certain time but forgetting to explicitly register a Command for that results in that never happening. Similarly, emitting a Command::Wake with the wrong timestamp may delay certain time-based actions.
The text was updated successfully, but these errors were encountered:
Previously, we would allocate each message twice:
1. When receiving the original packet.
2. When forming the resulting channel-data message.
We can optimise this to only one allocation each by:
1. Carrying around the original `ChannelData` message for traffic from
clients to peers.
2. Pre-allocating enough space for the channel-data header for traffic
from peers to clients.
Local flamegraphing still shows most of user-space activity as
allocations. I did occasionally see a throughput of ~10GBps with these
patches. I'd like to still work towards #4095 to ensure we handle
anything time-sensitive better.
This is much more robust than the previous implementation because we now
go through all allocations and channels every time we get a
`handle_timeout` and clean up everything that is expired.
Resolves: #4095.
The relay was the first SANS-IO component written for
firezone
. With the experience onsnownet
, I am no longer convinced that it was written in a very good way. In particular, bugs like #4094 are a result of some of its design choices.To alleviate future bugs and make maintenance easier, we should rewrite
relay::Server
to an API similar tosnownet
:poll_transmit
for sending messagespoll_timeout
for when we want to be woken nexthandle_timeout
for performing time-based actionsIn the current design, the above are combined into
Command
s. This can lead to subtle bugs where something needs to be performed at a certain time but forgetting to explicitly register aCommand
for that results in that never happening. Similarly, emitting aCommand::Wake
with the wrong timestamp may delay certain time-based actions.The text was updated successfully, but these errors were encountered: