diff options
author | Andreas Voellmy <andreas.voellmy@gmail.com> | 2015-03-09 18:27:41 -0400 |
---|---|---|
committer | Andreas Voellmy <andreas.voellmy@gmail.com> | 2015-03-09 18:27:42 -0400 |
commit | 74625d6847e970e8bdc6991c327515b3e10b231b (patch) | |
tree | bae80afff917229456182cbe4b166ac458d560be /LICENSE | |
parent | e76f86646229b3f8bcdc6ad71d464104c639f431 (diff) | |
download | haskell-74625d6847e970e8bdc6991c327515b3e10b231b.tar.gz |
RTS/IOManager: fix trac issue #9722.
Summary:
Whenever the RTS has been inactive for idleGCDelayTime, the idle timer
fires and calls wakeUpRts(), which in turn calls ioManagerWakeup(),
which in turn writes a byte (or a few) to a file descriptor (stored in
the io_manager_wakeup_fd variable) registered by the TimerManager and
on which the TimerManager will wait. (Note that the write will only
occur if the file descriptor is non-negative.) When the RTS shuts
down, it shuts down the TimerManager, and in this process the file
descriptor stored in io_manager_wakeup_fd is closed. In the error
case, the idle timer fires after the close of the file occurs, and
then the write() call in ioManagerWakeup() fails and the
aforementioned error message gets printed.
This patch solves the problem by (1) having the TimerManager (via
Control) write -1 to io_manager_wakeup_fd just before closing the file
descriptor written in io_manager_wakeup_fd, and (2) having
ioManagerWakeup() ignore an error returned by write() in the case that
the write returned -1 and the io_manager_wakeup_fd is -1.
Reviewers: austin, simonmar, hvr, thomie
Reviewed By: thomie
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D722
GHC Trac Issues: #9722
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions