Skip to content

Commit 3c23037

Browse files
authored
fix spurious exit when epoll_wait is interrupted by a signal (#125)
1 parent 094e2e7 commit 3c23037

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/timer/epoll.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ impl Timer {
6262
}
6363

6464
// Fire @ 10th sec
65-
Timer::epoll_wait(timer_fd, epoll_fd)?;
65+
let res = Timer::epoll_wait(timer_fd, epoll_fd);
66+
if matches!(&res, Err(PyroscopeError::Io(err)) if err.kind() == std::io::ErrorKind::Interrupted)
67+
{
68+
continue;
69+
}
70+
res?;
6671

6772
// Get the current time range
6873
let from = TimerSignal::NextSnapshot(get_time_range(0)?.from);

0 commit comments

Comments
 (0)