larry-robotics / elkodon Goto Github PK
View Code? Open in Web Editor NEWElkodon - true zero-copy inter-process-communication in rust
License: Apache License 2.0
Elkodon - true zero-copy inter-process-communication in rust
License: Apache License 2.0
src/bin/*
and old rust_experiments
/tmp/elkodon
iceoryx´ strings with
elkodon`pal/settings
&[u8]
can be replaced with &str
elkodon_bb_posix::SignalHandler
from public API and examples, introduce eventloop::wait()
instead (maybe with better name)get_
prefix for getter but a set_
prefix for setter[workspace.package]
version = ""
repository = ""
homepage = ""
authors = []
edition = "2021"
license = ""
categories = ["ipx"]
description = "elkodon: zero copy ipc"
Write contribution md with the content:
elkodon
vs Elkodon
tracing
and log
tracing
and log
elk-##ISSUE_NUMBER##-##BRANCH_NAME##
Cargo.toml
and the subcrates inherit from itCurrently, when creating/opening a service with an existing name but a different messaging pattern one receives the failure that it either exists or that the messaging pattern does not match.
It would be better if this would be allowed and that a service is uniquely identified by the messaging pattern and the name.
Should be easily implementable, just hash the messaging pattern as well to acquire the services uuid.
Currently, the elkodon logger uses its own log backend as default. To allow it to integrate seamlessly into other frameworks, the major log frameworks log
and tracing
shall be supported via feature flags.
log
and tracing
sinksREADME.md
elkodon/lib.rs
In the elkodon.toml
file an additional directory (/tmp/elkodon/
as root path instead /tmp
) shall be created to prevent clashes with other applications. More high-level constructs are then required to create subdirectories like /tmp/elkodon/services
when neither the dir elkodon
or services
exist (recursive subdirectory creation).
When elkodon_pp_posix::Directory::create()
would create them recursively the issue would be fixed otherwise these higher constructs get the error that part of the path do not exist.
From #25 (comment)
========
@elfenpiff I found this https://stackoverflow.com/questions/35988775/how-can-i-cause-a-panic-on-a-thread-to-immediately-end-the-main-thread/36031130#36031130
The following code would terminate the whole test when an assert in a thread fails. It can also be placed in a function which could be called at the start of a test
let orig_hook = panic::take_hook();
panic::set_hook(Box::new(move |panic_info| {
// invoke the default handler and exit the process
orig_hook(panic_info);
process::exit(1);
}));
========
Currently, it can happen that due to some API adjustments code examples in the markdown files are no longer running. The Geoffrey solves this problem.
Only provide code examples in combination with geoffrey in markdown files.
When executing the discovery example, all services that are listed are removed.
In ubuntu 22.04 the call getsockopt
with SO_RCVBUF
does not return the actual receive buffer size. The tests have to be adjusted that the internal buffer size of ubuntu is capped to 11.
Hi,
the code looks promising. However, it is now licensed as GPL.
Would it be possible to change the license to MPL?
I think MPL would allow wide adoption while still ensuring contributions come back to the main source.
Thank you for considering.
cargo doc
creates warnings despite a successful cargo test --workspace --doc
run.
cargo doc
to CI runOperating system:
Rust version:
Output of: rustc 1.73
Cargo version:
Output of: cargo 1.73
elkodon version:
main
branch
Observed result or behaviour:
The test publisher_block_when_unable_to_deliver_blocks
in crate elkodon
deadlocks sometimes in windows
The ability to quickly communicate with the maintainers of elkodon or to promote new features requires some kind of social media accounts. Explore what kind of mechanisms can be used and create an account.
Operating system:
Rust version:
Output of: rustc 1.73
Cargo version:
Output of: cargo 1.73
elkodon version:
main
branch
Observed result or behaviour:
In elkodon_pal/posix/src/windows/mman.rs
the shm_unlink
call uses DeleteFileA
. When a file is opened and deleted with this call it successfully returns. If DeleteFileA
is again called while the file is opened it will set the GetLastError
to ERROR_ACCESS_DENIED
instead of ERROR_FILE_NOT_FOUND
, see: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-deletefilea
This causes all elkodon_cal
tests to fail that are using shared memory. Whenever std::mem::forget
is called in such a concept, the file descriptor is leaked and a subsequent second remove
call will return permission denied instead of false.
The quick-fix Errno::set(Errno::ENOENT);
in elkodon_pal/posix/src/windows/mman.rs
(shm_unlink
) shall be removed and the concept tests must be adjusted.
Currently, the default config file for windows is named config_win.toml
to handle the windows path style. The unix variant is named config.toml
.
Both should be named config.toml
but the problem is, how to deliver two different default config files one for windows and one for the rest of the systems.
The error handling strategy must be documented.
enum
s as error codesenum
error codes of an higher architectural levelstd::error::Error
and later (when it is in stable) core::error::Error
is implemented for all error enums.The issue shall be concluded with a markdown file explaining the above points and showing some code snippets to illustrate them.
From @elBoberido
I found another solution in the zstd crate. They use derive_more
with a feature flag to derive Error
only on std. This makes would allow no_std
on stable but without the Error
trait. Something to think of.
They basically did this
[dependencies]
derive_more = { version = "0.99", default-features = false, features = ["display", "from"] }
[features]
default = ["std"]
std = ["derive_more/error"]
#[derive(Debug, derive_more::Display, derive_more::From)]
#[cfg_attr(feature = "std", derive(derive_more::Error))]
#[non_exhaustive]
pub enum Foo {
#[display(fmt = "Bar occurred. Is: {baz}, must be either 1 or 2")]
Bar { baz: u8 },
//...
}
The attributes on the enum tags are quite similar to thiserror
so it wouldn't be too hard to switch between the two crates.
To be able to check certain CI failures it is important to recreate the exact environment. This is the exact puprose of ice_env.sh in iceoryx.
The script can be adjusted so that it works also for elkodon.
Observed result or behaviour:
It is possible to loan
a sample and immediately publish
it without initializing the data.
Expected result or behaviour:
With safe Rust this should not compile.
Conditions where it occurred / Performed steps:
Compile this code
let sample = publisher.loan()?;
publisher.send(sample)?;
I think we can borrow some code from iceoryx-rs and let the API for uninitialized samples return a SampleMut<MaybeUninit<T>>
instead of a SampleMut<T>
. The user would have to call the unsafe assume_init
method in order to get a SampleMut<T>
to be able to publish the sample.
This is the iceoryx-rs API for uninitialized samples
let mut sample = publisher.loan_uninit()?;
let sample = unsafe {
(*sample.as_mut_ptr()).counter = counter;
sample.assume_init()
};
publisher.publish(sample);
This would lead to a compile time error
let sample = publisher.loan_uninit()?;
publisher.publish(sample);
When an application crashes, it can happen that a service is only partially removed and becomes unusable.
An internal service and/or a command line application shall cleanup the remainders of such services.
The following use cases shall be considered:
This issue takes care of small documentation fixes like typos or out-of-date examples/explanations.
If a thread in a test encounters an assert
and suddenly terminates, it is possible that some succeeding variables, required for terminating the whole tests, are not being set. Therefore, either avoid assert
s in tests or use it only if it occurs not before such a test flow control variable.
Operating system:
Rust version:
Output of: rustc 1.73.0
Cargo version:
Output of: cargo 1.73.0
elkodon version:
main
branch
Observed result or behaviour:
The test access_control_list_string_conversion_works
fails.
Expected result or behaviour:
The test access_control_list_string_conversion_works
passes.
Currently, the publish-subscribe benchmark is working in one process between two threads. The benchmark shall be extended so that it can also run between two distinct processes.
Fix shared memory list issue and activate windows on the cirrus ci.
If one would like to print a state overview of a service it would be nice if the port_factory::{event|publish_subscribe|...}
would have implemented Display
to show the overview from the example.
Explore if the bot from the article: https://www.cncf.io/blog/2023/06/06/a-chatgpt-powered-code-reviewer-bot-for-open-source-projects/ can be applied to elkodon
A pub-sub service has the ability to define a max buffer size for a subscriber but the subscriber is unable to reduce its buffer size - every subscriber has the same buffer size.
So we need to introduce a setting in the subscriber port factory to set a custom buffer size.
If the example code is also run, we can ensure that the example is also functional working. Therefore, we should remove the no_run
tag from as many documentation code examples as possible.
The CI unveiled a few issues with some tests. Those tests are temporarily skipped and need to be re-enabled.
Just seach for 'TODO elk-#30:' to find all the sipped tests.
When two elkodon_cal
constructs interact with each other, we need to add some initial versioning information to ensure that not to incompatible versions of the same constructs are interacting. This could lead to undefined behavior and hard to unravel bugs.
They could be, for instance incompatible since the member order of shared management constructs has changed or members have been added/removed. Or the internal communication protocol was updated.
Introduce a const SHM_API_VERSION: u64
constant inside elkodon_cal
, that must be checked before any of these constructs start to interact on an ipc level.
Constructs that use shared memory could add this constant to the beginning, as the first value, to their shared memory. If the construct does not use shared memory, one could create a file and store the number value is binary, or human-readable value, in there.
This issue takes care of setting up the CI and maintaining it
Currently, the enable_safe_overflow
behavior is part of the service but it should be actually a subscriber property for its buffer behavior.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.