Skip to content

S13.18: Windows BDD exercising the portable ring buffer #244

Description

@DavidCozens

Parent epic: #40

Goal

Wire the Windows BDD harness to exercise the buffering path end-to-end via the new portable ring buffer (SolidSyslogCircularBuffer, S04.05). Prove the ring buffer behaves identically on Windows (MSVC, Winsock) as on POSIX, and unblock the cross-platform UDP and TCP buffered scenarios on the Windows runner.

Out of scope for this story:

  • Retiring PosixMessageQueueBuffer from the Linux Threaded example — stays as-is.
  • Adding SwitchingSender, file-backed BlockStore, or TLS to the Windows example — those land later.

Plan / slices

  1. BDD prompt-protocol portability (test-side fix). Replace select.select + os.read in wait_for_prompt (Bdd/features/steps/syslog_steps.py) with a thread-based stdout reader so the prompt protocol works on both POSIX and Windows pipe fds. Same Python signature; no production change. Verified by the Linux BDD container staying green.

    Rationale: chosen over a production drain-on-shutdown path so the library/example don't bake test convenience into shipped semantics, and so ungraceful shutdown remains a real testable scenario.

  2. Windows example: NullBuffer → CircularBuffer + service thread. Replace SolidSyslogNullBuffer_Create(sender) (Example/Windows/SolidSyslogWindowsExample.c:105) with caller-allocated SolidSyslogCircularBuffer storage backed by SolidSyslogWindowsMutex. Add a Windows service-thread launcher (_beginthreadex driving the existing ExampleServiceThread_Run). Wire shutdown_flag + thread-join into the destruction path, mirroring the Linux Threaded example. Reuse Example/Common/ helpers wherever possible; flag any factory code that wants hoisting from per-platform main.c files into Common/ rather than silently widening this story's scope.

  3. Tag + step-prose adjustments. Drop the @buffered exclusion from the two cross-platform features so they run on Windows:

    • Bdd/features/buffered.feature (UDP)
    • Bdd/features/tcp_transport.feature (TCP)

    Rename the step text in those two features from the threaded example… to the buffered example…. The other @buffered features stay as-is — they really are pthread-specific (file store, switching sender, TLS, syslog-ng UNIX-socket reload) and keep the the threaded example prose. Update the step layer to dispatch the new wording: route to THREADED_BINARY on the Linux runner and context.example_binary (the buffered Windows binary) on the Windows runner. Update CI exclusion in .github/workflows/ci.yml accordingly.

  4. DEVLOG entry + close-out.

Acceptance

  • bdd-windows-otel runs Bdd/features/buffered.feature and Bdd/features/tcp_transport.feature and they pass.
  • bdd-linux-syslog-ng continues to pass — both features still work via the Linux Threaded binary.
  • Other @buffered features (store, switching, mtls, tls, reconnect, etc.) continue to be excluded on the Windows runner via tags and remain green on Linux.
  • Windows example uses SolidSyslogCircularBuffer + SolidSyslogWindowsMutex + a Windows service thread; no NullBuffer reference left in Example/Windows/.

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    storyStory issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions