feat: make Unix domain socket path and mode configurable#84
Conversation
Make the datarouter Unix domain socket configurable via environment
variables while maintaining backward compatibility (defaults to abstract
namespace with "datarouter_socket" path).
This enables containerized deployments where both the datarouter and
applications run in separate containers and communicate via file-based
sockets with shared volume mounts. Also supports running multiple
datarouter instances with unique abstract namespace sockets.
Changes:
- Add socket_config module for centralized socket configuration
- Support DATAROUTER_SOCKET_PATH environment variable (default: "datarouter_socket")
- Support DATAROUTER_SOCKET_MODE environment variable ("abstract" or "file", default: "abstract")
- Update socketserver to use configurable socket address
- Add comprehensive unit tests (9 tests, all passing)
- Platform-specific defaults: Linux uses abstract, QNX uses file-based
Environment variables:
- DATAROUTER_SOCKET_PATH: Socket path (e.g., "/var/run/datarouter.sock" or "custom_socket")
- DATAROUTER_SOCKET_MODE: "abstract" for abstract namespace or "file" for filesystem-based
Example usage for containerized datarouter + application:
# Both containers set:
export DATAROUTER_SOCKET_PATH=/var/run/datarouter.sock
export DATAROUTER_SOCKET_MODE=file
# And mount the same volume at /var/run
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
|
please come to our FT meeting to discuss |
|
@arsibo Sorry for the late reply. Joining meeting is not the most practical thing for me. Is there a possibility/place where we could have this discussion asynchronously? |
|
@anmittag I'm a little confused about this MR being assigned to me. Isn't the assignee supposed to do something with this MR? |
|
Well @pypingou you have started a pr. I am expecting a pr author to follow up or accompany the pr till closure. |
|
@anmittag ok, for me the assignee would be more the reviewer rather than the author, but ok that's fine. I'm unclear what the next steps are though. I've asked if there is an asynchronous alternative to attending the logging meeting and so far without answer. Let's just discuss in this PR first and resort to a meeting only if we really need a higher-bandwidth mode of communication? Is there anything in this PR that is not clear to you? |
|
@pypingou no reviewers are mentioned separately |

Make the datarouter Unix domain socket configurable via environment variables while maintaining backward compatibility (defaults to abstract namespace with "datarouter_socket" path).
This enables containerized deployments where both the datarouter and applications run in separate containers and communicate via file-based sockets with shared volume mounts. Also supports running multiple datarouter instances with unique abstract namespace sockets.
Changes:
Environment variables:
Example usage for containerized datarouter + application:
Both containers set:
export DATAROUTER_SOCKET_PATH=/var/run/datarouter.sock
export DATAROUTER_SOCKET_MODE=file
And mount the same volume at /var/run
Notes for Reviewer
Pre-Review Checklist for the PR Author
Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References
Closes #