-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: flush Record when deadline is exceeded
Watermark and WakeupEvents allow reducing the rate at which user space is woken up. This creates an edge case where Read() returns os.ErrDeadlineExceeded even though there is data in one of the rings. This is also a problem in the ringbuf package, where we've solved this by checking whether there is any data when encountering an ErrDeadlineExceeded. Adopt the same approach for the perf reader. TestPerfReaderWakeupEvents has to change since it relies on the old behaviour of not checking for pending data. Rework the test so that it doesn't test the ErrDeadlineExceeded error: it's not so important that we don't wake up early. Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
- Loading branch information
Showing
2 changed files
with
49 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters