Work around spurious epoll notifications.
Sometimes it seems like we can get into a situation where we are unable to remove an fd from the epoll set but it keeps sending us events anyhow. Defensively rebuild the epoll set in this case to prevent us from spinning forever. Bug: 21271428 Change-Id: I5607e565f2e12460d7113a1f62a70d38d334e271
This commit is contained in:
parent
7eb3abdb3b
commit
18a574f715
|
@ -567,7 +567,12 @@ int Looper::removeFd(int fd, int seq) {
|
|||
#endif
|
||||
scheduleEpollRebuildLocked();
|
||||
} else {
|
||||
// Some other error occurred. This is really weird because it means
|
||||
// our list of callbacks got out of sync with the epoll set somehow.
|
||||
// We defensively rebuild the epoll set to avoid getting spurious
|
||||
// notifications with nowhere to go.
|
||||
ALOGE("Error removing epoll events for fd %d, errno=%d", fd, errno);
|
||||
scheduleEpollRebuildLocked();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue