Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
854c69b9
Commit
854c69b9
authored
Jul 04, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
master: do not fail on leap seconds
parent
4ebf90ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
neo/master/transactions.py
neo/master/transactions.py
+7
-6
No files found.
neo/master/transactions.py
View file @
854c69b9
...
@@ -50,9 +50,13 @@ def packTID(utid):
...
@@ -50,9 +50,13 @@ def packTID(utid):
offset
,
multiplicator
)
offset
,
multiplicator
)
packed_higher
*=
multiplicator
packed_higher
*=
multiplicator
packed_higher
+=
value
packed_higher
+=
value
assert
isinstance
(
lower
,
(
int
,
long
)),
lower
# If the machine is configured in such way that gmtime() returns leap
assert
0
<=
lower
<
TID_LOW_OVERFLOW
,
hex
(
lower
)
# seconds (e.g. TZ=right/UTC), then the best we can do is to use
return
pack
(
'!LL'
,
packed_higher
,
lower
)
# TID_LOW_MAX, because TID format was not designed to support them.
# For more information about leap seconds on Unix, see:
# http://en.wikipedia.org/wiki/Unix_time
# http://www.madore.org/~david/computers/unix-leap-seconds.html
return
pack
(
'!LL'
,
packed_higher
,
min
(
lower
,
TID_LOW_MAX
))
def
unpackTID
(
ptid
):
def
unpackTID
(
ptid
):
"""
"""
...
@@ -282,9 +286,6 @@ class TransactionManager(object):
...
@@ -282,9 +286,6 @@ class TransactionManager(object):
"""
"""
tm
=
time
()
tm
=
time
()
gmt
=
gmtime
(
tm
)
gmt
=
gmtime
(
tm
)
# See leap second handling in epoch:
# https://en.wikipedia.org/wiki/Unix_time
assert
gmt
.
tm_sec
<
60
,
tm
tid
=
packTID
((
tid
=
packTID
((
(
gmt
.
tm_year
,
gmt
.
tm_mon
,
gmt
.
tm_mday
,
gmt
.
tm_hour
,
(
gmt
.
tm_year
,
gmt
.
tm_mon
,
gmt
.
tm_mday
,
gmt
.
tm_hour
,
gmt
.
tm_min
),
gmt
.
tm_min
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment