[Boost-bugs] [Boost C++ Libraries] #11480: Interprocess get_last_bootup_time use of Event Log on Windows is completely unreliable

Subject: [Boost-bugs] [Boost C++ Libraries] #11480: Interprocess get_last_bootup_time use of Event Log on Windows is completely unreliable
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-07-15 21:33:40


#11480: Interprocess get_last_bootup_time use of Event Log on Windows is completely
unreliable
---------------------------------------+--------------------------
 Reporter: Craig White <cwhite102@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.57.0 | Severity: Showstopper
 Keywords: message_queue bootup |
---------------------------------------+--------------------------
 We have been running into an issue where creating an interprocess
 message_queue would start to fail after some time on a production system
 (Windows 2012 Server) - throwing an interprocess_exception with error code
 1 (native code=0).

 After setting up remote debugging on the production system, we tracked it
 down to the get_last_bootup_time() function returning false because it
 couldn't find the 'Event Log Started (6005)' event in the log.
 (win32_api.hpp)

 The Event Logs don't last forever. Windows prunes old events when the
 logs grow. If I understand the use of the Event Log to determine a boot
 time correctly, then this is a nasty hack and must be changed. It is not
 reliable.

 Perhaps a solution would be to maintain a 'current' boot time file. You
 could attempt to find the boot time using the Event log (or other
 technique) and write it to the 'current' file. If you couldn't obtain the
 boot time, just use the existing 'current' file. If no current file
 exists, write one with an arbitrary time (eg. 00000). At least this way,
 it will never fail, and usually will roll over to a new folder after a
 reboot.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11480>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC