Skip to content

minidumper: Socket address type confusion #106

@kawadakk

Description

@kawadakk

Is your feature request related to a problem? Please describe.
minidumper's API reference does not mention that a socket name uses a different address type depending on whether it is provided as &str or &Path, which took us a few hours to figure out why our client (which used str passed by JSON) could not connect to the server (which used Path).

Describe the solution you'd like
I propose making minidumper::ipc::SocketName public and removing the implicit conversion via SocketName: From<&{str,Path}>, requiring the caller to explicitly specify an address type.

// Named socket
let temp = tempdir();
Server::with_name(SocketName::Path(&temp.path().join("foo.sock")));

// Abstract socket
#[cfg(any(target_os = "linux", target_os = "android"))]
{
    Server::with_name(SocketName::Abstract(b"foo"));
}

Describe alternatives you've considered
Alternatively, this issue could be somewhat mitigated by clearer documentation:

  • Document in minidumper::{Server,Client}::with_name how name is processed.
  • Or add a section to the crate-level documentation describing how a socket name is specified.
  • Or make minidumper::ipc::SocketName visible in the documentation and add a note about the difference between From<&{str,Path}>.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions