Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tempsdb
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
tempsdb
Commits
dc400adc
Commit
dc400adc
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
support more error conditions
parent
672523a8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
setup.py
+1
-1
1 addition, 1 deletion
setup.py
tempsdb/chunks.pyx
+6
-3
6 additions, 3 deletions
tempsdb/chunks.pyx
with
8 additions
and
5 deletions
README.md
+
1
−
1
View file @
dc400adc
...
...
@@ -28,7 +28,7 @@ You will need to have both snakehouse and satella installed.
## v0.4.4
*
_TBA_
*
more error conditions during mmap will be supported as well
## v0.4.3
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
dc400adc
...
...
@@ -25,7 +25,7 @@ if 'CI' in os.environ:
setup
(
name
=
'
tempsdb
'
,
version
=
'
0.4.4a
1
'
,
version
=
'
0.4.4a
2
'
,
packages
=
[
'
tempsdb
'
],
install_requires
=
[
'
satella>=2.14.21
'
,
'
ujson
'
],
ext_modules
=
build
([
Multibuild
(
'
tempsdb
'
,
find_pyx
(
'
tempsdb
'
)),
],
...
...
This diff is collapsed.
Click to expand it.
tempsdb/chunks.pyx
+
6
−
3
View file @
dc400adc
...
...
@@ -30,7 +30,7 @@ cdef class AlternativeMMap:
def
__init__
(
self
,
io_file
:
io
.
BinaryIO
,
file_lock_object
):
self
.
io
=
io_file
self
.
io
.
seek
(
0
,
2
)
self
.
io
.
seek
(
0
,
io
.
SEEK_END
)
self
.
size
=
self
.
io
.
tell
()
self
.
file_lock_object
=
file_lock_object
...
...
@@ -117,7 +117,10 @@ cdef class Chunk:
try
:
self
.
mmap
=
mmap
.
mmap
(
self
.
file
.
fileno
(),
0
)
except
OSError
as
e
:
if
e
.
errno
==
12
:
# Cannot allocate memory
if
e
.
errno
in
(
11
,
# EAGAIN - memory is too low
12
,
# ENOMEM - no memory space available
19
,
# ENODEV - fs does not support mmapping
75
):
# EOVERFLOW - too many pages would have been used
self
.
file_lock_object
=
threading
.
Lock
()
self
.
mmap
=
AlternativeMMap
(
self
.
file
,
self
.
file_lock_object
)
else
:
...
...
@@ -210,7 +213,7 @@ cdef class Chunk:
self
.
file_lock_object
.
acquire
()
try
:
self
.
file_size
+=
self
.
page_size
self
.
file
.
seek
(
0
,
2
)
self
.
file
.
seek
(
0
,
io
.
SEEK_END
)
ba
=
bytearray
(
self
.
page_size
)
ba
[
self
.
page_size
-
FOOTER_SIZE
:
self
.
page_size
]
=
STRUCT_L
.
pack
(
self
.
entries
)
self
.
file
.
write
(
ba
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment