Skip to content

Windows/Event Loop: GetQueuedCompletionStatus should not panic in debug mode #10571

@mjoerussell

Description

@mjoerussell

Zig Version

0.10.0-dev.37+3bd0575cf

Steps to Reproduce

When using GetQueuedCompletionStatus to process async network requests on Windows, cause a common error like disconnecting the peer. In this case, the function immediately panics with this error:

thread 20816 panic: unexpected error: Win32Error.NETNAME_DELETED

In a release build, this error is ignored entirely.

Reference: GetQueuedCompletionStatus.

Expected Behavior

GetQueuedCompletionStatus should return an error in all failure cases instead of panicking in debug builds, and doing nothing in release builds. The current behavior means that, when using this function, there's no way to detect that a certain error happened and then to handle it in an application-specific way.

Actual Behavior

GetQueuedCompletionStatus panics in all but a few cases in debug builds.

Example panic message:

thread 20816 panic: unexpected error: Win32Error.NETNAME_DELETED

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.os-windowsMicrosoft Windowsstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions