Philipp Oppermann
9bb57ee531
Don't send replies for `SendMessage` requests when using TCP
Allows queueing of multiple messages on the TCP socket, which considerably improves throughput.
2 years ago
Philipp Oppermann
2ccc170649
Send all queued incoming events at once on `NextEvent` request
Sends a list of all queued events in the reply instead of sending them one-by-one. This way, we avoid some communication overhead.
2 years ago
Philipp Oppermann
00421e2bcd
Send small messages directly without shared memory
We currently need an additional request to prepare zero-copy shared memory messages. For small messages, it might be faster to avoid this extra round-trip and send the message directly over TCP. This commit implements support for this. Messages smaller than a threshold (currently set to 4096 bytes) are sent via TCP, while larger messages still use shared memory.
This step also enables future optimizations such as queueing output messages in order to improve the throughput.
2 years ago
Philipp Oppermann
085a0723db
Re-add joining of event stream thread, now based on shared ownership and using a timeout
Without joining the thread it is killed suddenly by the OS when the executable exits. This causes interrupted connections to the daemon, which leads to some errors in the log messages. This commit fixes this by joining the event stream thread again, with the following improvements:
- Instead of joining the thread directly on drop, we now do the joining in a second thread and report the join result over a channel. This allows us to use a timeout when waiting for the join result in the drop implementation, so that we don't block indefinitely.
- We now share the ownership of the join handle between the node and the event stream. This way, its drop handler is only run after both instances were dropped. This way we avoid the deadlock that happened when joining the event steam thread before the event stream instance was dropped.
2 years ago
Philipp Oppermann
125638f27e
Report event stream errors through channel instead of panicking
Avoids the need to catch the thread's panics.
2 years ago
Philipp Oppermann
2ba397c644
Fix: Don't wait on event stream thread on drop, as it might be dropped later
It is not guaranteed that the `EventStream` is dropped before the `DoraNode`. If it is dropped later on the same thread, this `join` leads to a deadlock.
2 years ago
Philipp Oppermann
0aebe9c3c4
Flush TCP connection after sending message
2 years ago
Philipp Oppermann
d334c6f243
Make `daemon` module of Rust node API private and reexport symbols
2 years ago
Philipp Oppermann
1e07a73a64
Merge branch 'main' into unify-nodes-and-operators
2 years ago
Philipp Oppermann
1553a198ef
Re-export dora-message from dora-core
2 years ago
Philipp Oppermann
0840cf0c0e
Implement support for TCP-based daemon connection in Rust node API
2 years ago
Philipp Oppermann
ff836d200c
Start adding back support for daemon communication over TCP
3 years ago
Philipp Oppermann
70bfa35d0c
Use rendezvous channel for forwarding inputs in node API
Since inputs are passed through borrowed shared memory, we need to report back when we're done with them. We do this through a drop handler. By using a rendezvous channel for forwarding, we avoid that the drop handler is stuck in the queue if the node finished already.
3 years ago
dependabot[bot]
b74a524031
Bump tokio from 1.23.1 to 1.24.2
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.23.1 to 1.24.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/commits )
---
updated-dependencies:
- dependency-name: tokio
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Philipp Oppermann
6eb9b46637
Close outputs of operators when they stop
We cannot wait until all operators of the runtime node are finished because operators might be subscribed to other operators.
3 years ago
Philipp Oppermann
77e71393c9
Add an async receive method
3 years ago
Philipp Oppermann
6438ef7413
Add special handling for zero-sized messages to avoid one roundtrip
3 years ago
Philipp Oppermann
cf95078ca1
Extract shared memory server/client into separate crate
To allow for individual testing and benchmarking. This will also enable reuse of the library in other projects.
3 years ago
Philipp Oppermann
bf978d9d7d
Always send register message first, also when subscribing
3 years ago
Philipp Oppermann
c6d864b20f
Make shmem server/client typed and report event stream closure
3 years ago
Philipp Oppermann
c9e8d8dfe4
Join event stream thread before exiting
3 years ago
Philipp Oppermann
827fb1b241
Fix: Don't use timeout on EventStream client
3 years ago
Philipp Oppermann
503a9497fd
Use shared memory for event stream too
3 years ago
dependabot[bot]
ae161e644c
Bump tokio from 1.21.2 to 1.23.1
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.21.2 to 1.23.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.21.2...tokio-1.23.1 )
---
updated-dependencies:
- dependency-name: tokio
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Philipp Oppermann
670c154e5e
Create a safer server/client API on top of `ShmemChannel`
3 years ago
Philipp Oppermann
8d1c3742a1
Implement disconnect signal for `ShmemChannel` and set it on drop
3 years ago
Philipp Oppermann
70298d836f
Start migrating the daemon control channel to shared memory
The goal is to avoid the latency of the TCP socket.
3 years ago
Philipp Oppermann
778d9d7eb7
Fix: Use correct length for received data
The shared memory region size might be larger because of padding.
3 years ago
Philipp Oppermann
619d0bb34b
Fix: limit slice length to requested length
On Windows, the size of the shared memory region is rounded up to the next multiple of the page size. By slicing the region to the expected size we allow nodes to assume that they get exactly the requsted size.
3 years ago
Philipp Oppermann
df5dcfb342
Merge branch 'main' into unify-nodes-and-operators
3 years ago
Philipp Oppermann
1516ee6559
Don't allocate shared memory when `data_len=0` when preparing output
3 years ago
Philipp Oppermann
cf89bf0d1c
Fix error messages
3 years ago
Philipp Oppermann
d3914cca60
Merge pull request #157 from dora-rs/release
Simplify release process
3 years ago
Philipp Oppermann
a2cc06ca50
Use drop tokens and reference counting to free shared memory again after usage
3 years ago
Philipp Oppermann
8225c9f1c5
Make events a borrowed type and report to daemon when they're dropped
3 years ago
Philipp Oppermann
8bfb665201
Set `TCP_NODELAY` for all TCP connections to reduce latency
3 years ago
Philipp Oppermann
ce4e5a1616
Send metadata through TCP for now
3 years ago
Philipp Oppermann
0ae5fc2ffa
Add dataflow ID to daemon messages
3 years ago
dependabot[bot]
2ba6b1c41c
Bump capnp from 0.14.9 to 0.14.11 ( #158 )
Bumps [capnp](https://github.com/capnproto/capnproto-rust ) from 0.14.9 to 0.14.11.
- [Release notes](https://github.com/capnproto/capnproto-rust/releases )
- [Commits](https://github.com/capnproto/capnproto-rust/compare/capnp-v0.14.9...capnp-v0.14.11 )
---
updated-dependencies:
- dependency-name: capnp
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Philipp Oppermann
433b7b4ed7
Merge branch 'main' into unify-nodes-and-operators
3 years ago
Philipp Oppermann
9a9394c204
Update Rust node API to parse new `NodeConfig`
3 years ago
Philipp Oppermann
d8260d5d2c
Inherit package version from workspace root
This way, we don't need to update the version manually in all sub-crates on every release.
3 years ago
Philipp Oppermann
2e7ef8b630
Implement shared memory mapping in node API
3 years ago
haixuanTao
b15d25b9a3
Fix clippy warnings
3 years ago
haixuanTao
9a0b303e98
Replace all versions to `v0.1.1`
3 years ago
haixuanTao
294990e307
Make `stop_thread` not borrow `communication` for static
3 years ago
Philipp Oppermann
201fd228f5
Remove communication layer from dora-node-api
3 years ago
Philipp Oppermann
c2e4948dd5
Update Rust node API to communicate through dora-daemon
3 years ago
Philipp Oppermann
7d85b92b2a
Connect to dora-daemon from node API and register with node ID
3 years ago
Philipp Oppermann
fc50a8232f
Create a request/reply communication layer abstraction
And a TCP-based implemenation.
3 years ago