Skip to content
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

EPOLLHUP event causes AssertionDefect to be thrown #6

Open
shunf4 opened this issue Aug 24, 2021 · 0 comments
Open

EPOLLHUP event causes AssertionDefect to be thrown #6

shunf4 opened this issue Aug 24, 2021 · 0 comments

Comments

@shunf4
Copy link

shunf4 commented Aug 24, 2021

https://github.com/xflywind/httpx/blob/7e8ca92efe921fbe2aa363ffafe3c443cc9b73fa/src/httpx.nim#L443-L444

When events[i].events contains neither Read nor Write, an AssertionDefect is thrown.

However, as per code lines in ioselectors:

https://github.com/xflywind/ioselectors/blob/6fcdbf3fddeb239885cd8bce15a0ab63c00647c0/src/ioselectors/ioselectors_wepoll.nim#L264-L270

only EPOLLOUT and EPOLLIN will be recorded in rkey.events. There is still the possibility for events like EPOLLHUP to take place, and cause rkey.events to be empty, and thus AssertionDefect is thrown in httpx:

...(25) ...
C:\Users\shunf4\.nimble\pkgs\prologue-0.4.4\prologue\core\application.nim(534) run
C:\Users\shunf4\.nimble\pkgs\prologue-0.4.4\prologue\core\beast\server.nim(31) serve
C:\Users\shunf4\.nimble\pkgs\httpx-0.2.4\httpx.nim(...) run
C:\Users\shunf4\.nimble\pkgs\httpx-0.2.4\httpx.nim(...) eventLoop
C:\Users\shunf4\.nimble\pkgs\httpx-0.2.4\httpx.nim(...) processEvents
C:\tools\Nim\nim-1.4.6\lib\system\assertions.nim(30) failedAssertImpl
C:\tools\Nim\nim-1.4.6\lib\system\assertions.nim(23) raiseAssert
C:\tools\Nim\nim-1.4.6\lib\system\fatal.nim(49) sysFatal
Error: unhandled exception: C:\Users\shunf4\.nimble\pkgs\httpx-0.2.4\httpx.nim(..., 16) `false`  [AssertionDefect]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant