Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
038ef9bb
Commit
038ef9bb
authored
Jun 14, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7a837040
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
wcfs/internal/wcfs_test.pyx
wcfs/internal/wcfs_test.pyx
+2
-2
wcfs/wcfs.go
wcfs/wcfs.go
+8
-6
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+4
-0
No files found.
wcfs/internal/wcfs_test.pyx
View file @
038ef9bb
...
...
@@ -65,13 +65,13 @@ cdef void on_sigbus(int sig, siginfo_t *si, void *_uc):
# - dump py-level traceback and abort.
# TODO turn SIGBUS into python-level exception? (see sigpanic in Go how to do).
writeerr
(
"
\
n
C: SIGBUS received; giving time to other threads"
+
writeerr
(
"
\
n
C: SIGBUS received; giving time to other threads
"
+
"to dump their exceptions (if any) ...
\
n
"
)
cdef
PyGILState_STATE
gstate
=
PyGILState_Ensure
()
PyGILState_Release
(
gstate
)
sleep
(
1
)
writeerr
(
"
\
n
C: SIGBUS thread traceback:
\
n
"
)
writeerr
(
"
\
n
C: SIGBUS
'ed
thread traceback:
\
n
"
)
PyGILState_Ensure
()
PyRun_SimpleString
(
"import traceback; traceback.print_stack()"
)
writeerr
(
"-> SIGBUS
\
n
"
);
...
...
wcfs/wcfs.go
View file @
038ef9bb
...
...
@@ -162,7 +162,7 @@
// file but with different <at>. This could be achieved via watching with
// @<at_min>, and then deciding internally which views needs to be adjusted and
// which views need not. Wcfs does not oblige clients to do so though, and a
// client is free to use as many head/watch open
en
ings as it needs to.
// client is free to use as many head/watch openings as it needs to.
//
// When clients are done with @<revX>/bigfile/<bigfileX> (i.e. client's
// transaction ends and array is unmapped), the server sees number of opened
...
...
@@ -1134,7 +1134,7 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
}
// we have the data - it can be used after watchers are updated
// XXX should we use ctx here? (see updateWatcher comments)
// XXX should we use ctx here? (see updateWatcher
s
comments)
f
.
updateWatchers
(
ctx
,
blk
,
treepath
,
zblk
,
blkrevMax
)
// data can be used now
...
...
@@ -1169,7 +1169,7 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
//
// Called with f.head.zconnMu rlocked.
//
// XXX do we really need to use/propagate caller contex here? ideally update
// XXX do we really need to use/propagate caller contex
t
here? ideally update
// watchers should be synchronous, and in practice we just use 30s timeout.
// Should a READ interrupt cause watch update failure?
func
(
f
*
BigFile
)
updateWatchers
(
ctx
context
.
Context
,
blk
int64
,
treepath
[]
btree
.
LONode
,
zblk
zBlk
,
blkrevMax
zodb
.
Tid
)
{
...
...
@@ -1434,9 +1434,11 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// blocks. If we don't, we can miss to send pin for a freshly read
// block which could have revision > w.at . XXX test
// XXX locking
// XXX register only if watch was created anew, not updated
.
// XXX register only if watch was created anew, not updated
?
f
.
watches
[
w
]
=
struct
{}{}
wlink
.
byfile
[
foid
]
=
w
// XXX defer -> unregister watch if error?
// pin all tracked file blocks that were changed in (at, head] range.
...
...
@@ -1484,8 +1486,8 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
return
err
}
// XXX
locking, place = ok? or move closer to at==zodb.InvalidTid ^^^
?
wlink
.
byfile
[
foid
]
=
w
// XXX
or register w to f & wlink here
?
// NOTE registering f.watches[w] and wlink.byfile[foid] = w must come together.
return
nil
}
...
...
wcfs/wcfs_test.py
View file @
038ef9bb
...
...
@@ -1197,6 +1197,10 @@ def test_wcfs():
wg
.
go
(
_
)
wg
.
wait
()
wl
.
close
()
# NOTE if wcfs.go does not fully cleanup this canceled watch and leave it
# in half-working state, it will break on further commit, as pin to the
# watch won't be handled.
# TODO -> add explicit check for ^^^ if/when moved to separate test.
# invalid requests -> wcfs replies error
wl
=
t
.
openwatch
()
...
...
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