Opened 4 years ago

Closed 4 years ago

#10317 closed bug (fixed)

Event manager: Multishot registrations only fire once

Reported by: bgamari Owned by:
Priority: normal Milestone: 7.10.2
Component: Compiler Version: 7.10.1
Keywords: Cc: AndreasVoellmy, basvandijk, liyang
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D849
Wiki Page:


Since D347 the event manager has had support for multishot event registration semantics, allowing the user to receive multiple events on an fd without requiring re-registration.

Unfortunately the implementation drops the registration after it fires, resulting in only one callback invocation.

Change History (9)

comment:1 Changed 4 years ago by AndreasVoellmy

Cc: AndreasVoellmy added

comment:2 Changed 4 years ago by basvandijk

Cc: basvandijk added

comment:3 Changed 4 years ago by bgamari

Differential Rev(s): D849

I've written a pair of tests exercising both failure modes,

comment:4 Changed 4 years ago by liyang

Cc: liyang added

comment:5 Changed 4 years ago by bgamari

Differential Rev(s): D849Phab:D849

comment:6 Changed 4 years ago by bgamari

Status: newpatch

comment:7 Changed 4 years ago by Austin Seipp <austin@…>

In 1c3832597b3e75456fc61628c4cd289d211c733b/ghc:

Fix dropped event registrations

D347 introduced a bug wherein the event manager would drop registrations that
should be retained during processing. This occurs when an fd has multiple
registrations, not all of which fire, as well as the case of multi-shot

I also do some general house-keeping, try to better document things, and fix a
bug which could result in unnecessary calls to `epoll_ctl`

Reviewed By: austin

Differential Revision:

GHC Trac Issues: #10317

comment:8 Changed 4 years ago by thoughtpolice

Status: patchmerge

comment:9 Changed 4 years ago by thoughtpolice

Resolution: fixed
Status: mergeclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.