Skip to content

"Ghost" send callback in macOS (kqueue) #105

Open
@TheWaWaR

Description

I'm writing a high performance MQTT benchmark tool with libxev, when I start 10000 MQTT client connections and setup the keep alive time to 5 seconds (send Pingreq message every 5s). The connecting process is ok, but after 5+ seconds later there maybe some "ghost" send callback happened with send operation. The "ghost" here means: after the callback been called and returned with a .disarm and then the callback will called again even without a loop.add().

Reproduce steps:

  • Start a MQTT broker
  • Start the benchmark tool with -c 10000
  • Wait for 5s+ and the there may have an invalid send callback

After some debug, the callback is called in kqueue.zig:434.

The source code is here.
The libxev commit id used is: 1dd3c9015a542757b049f6d33beb8941f57bce1f

If I uncomment main.zig:291:

comp.* = .{};

There will be a op=noop log with a following panic.

NOTE: I also run this program in ARM64 Linux, with no problem.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions