Skip to content

[pull] master from MusicPlayerDaemon:master #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 21, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented May 21, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Sync with upstream changes to enhance socket event handling, introduce unified dead-socket masks, streamline the build toolchain, and remove deprecated or redundant code

Bug Fixes:

  • Remove deprecated StringToken function from StringAPI

Enhancements:

  • Add CancelOnlyRead and CancelOnlyWrite methods to SocketEvent and PipeEvent for finer event scheduling control
  • Introduce CancelReadAndScheduleReadHangup under USE_EPOLL in SocketEvent
  • Define READ_HANGUP and DEAD_MASK constants in EpollEvents, PollEvents, and WinSelectEvents
  • Remove redundant assert in TimerWheel insertion logic

Build:

  • Simplify static linking flags in the Python build toolchain

MaxKellermann and others added 8 commits May 21, 2025 12:32
POSIX demands that CLOCK_MONOTONIC must never go backwards, but in
practice, there can be small warps, e.g. after a CPU migration.  If
that happens, it's a POSIX violation, but please don't crash my code
with assertion failure.  Sigh.
This implies "-static-libstdc++ -static-libgcc" and also links the
pthread library (i.e. libwinpthread-1) statically.

Closes #2287
@pull pull bot added the ⤵️ pull label May 21, 2025
@pull pull bot merged commit 8f9f69a into CartoonFan:master May 21, 2025
Copy link

sourcery-ai bot commented May 21, 2025

Reviewer's Guide

This PR refines event scheduling and masking by adding granular cancellation methods, unifies dead-connection masks across backends, removes obsolete code, tweaks build flags, and cleans up a redundant assertion in the timer wheel.

Sequence Diagram: Using CancelReadAndScheduleReadHangup for Socket Events

sequenceDiagram
    participant CL as ClientLogic
    participant SE as SocketEvent

    CL->>SE: CancelReadAndScheduleReadHangup()
    activate SE
    SE-->>SE: Schedule((flags & ~READ) | READ_HANGUP)
    deactivate SE
    alt Hangup Occurs
        SE-->>CL: Notify Hangup (due to READ_HANGUP)
    end
Loading

Sequence Diagram: Using CancelOnlyRead to Preserve Implicit Flags

sequenceDiagram
    participant EH as EventHandler
    participant SE as SocketEvent

    EH->>SE: CancelOnlyRead()
    activate SE
    SE-->>SE: Schedule(current_flags & ~READ)
    deactivate SE
Loading

Class Diagram: Updates to Event Handling Classes and Structs

classDiagram
    class SocketEvent {
        +CancelOnlyRead(): void
        +CancelOnlyWrite(): void
        +CancelReadAndScheduleReadHangup(): void
    }

    class PipeEvent {
        +CancelOnlyRead(): void
        +CancelOnlyWrite(): void
    }
    PipeEvent o-- SocketEvent : uses

    class EpollEvents {
        +READ_HANGUP: const unsigned$
        +DEAD_MASK: const unsigned$
    }

    class PollEvents {
        +DEAD_MASK: const unsigned$
    }

    class WinSelectEvents {
        +DEAD_MASK: const unsigned$
    }
Loading

File-Level Changes

Change Details Files
Introduce fine‐grained read/write cancellation in SocketEvent
  • Include Features.h for epoll guard
  • Add CancelOnlyRead and CancelOnlyWrite methods
  • Under USE_EPOLL, add CancelReadAndScheduleReadHangup
src/event/SocketEvent.hxx
Define DEAD_MASK and extend hangup flags in event backends
  • In EpollEvents add READ_HANGUP and DEAD_MASK
  • In PollEvents add DEAD_MASK
  • In WinSelectEvents add DEAD_MASK
src/event/EpollEvents.hxx
src/event/PollEvents.hxx
src/event/WinSelectEvents.hxx
Propagate new cancellation APIs to PipeEvent
  • Forward CancelOnlyRead and CancelOnlyWrite to underlying event
src/event/PipeEvent.hxx
Remove deprecated StringToken utility
  • Delete static inline StringToken function
src/util/StringAPI.hxx
Simplify static linking in build toolchain
  • Replace '-static-libstdc++ -static-libgcc' with '-static'
python/build/toolchain.py
Clean up redundant assertion in TimerWheel
  • Remove assert(now >= last_time) from Insert
src/event/TimerWheel.cxx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant