os_file_fsync() should handle fsync() returning EINTR

Bug #1262651 reported by Laurynas Biveinis on 2013-12-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server
Medium
Unassigned
5.1
Medium
Unassigned
5.5
Medium
Unassigned

Bug Description

Splitting out the fsync() case out of bug 764395:

[19 Dec 12:46] Laurynas Biveinis

Description:
fsync() is documented by POSIX to have EINTR as one of the valid return values [1]. Thus, os_file_fsync() should handle it and retry instead of failing. Note that the same function in mysys (my_sync()) does this.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html

This was discovered while fixing bug 60788 in Percona Server.

How to repeat:
Code analysis

Suggested fix:
The function already has a retry loop, add a case for ret == -1 && errno == EINTR.

Changed in percona-server:
status: New → Fix Released
tags: added: upstream
Changed in percona-server:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.