Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
65c9a383
Commit
65c9a383
authored
Dec 19, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7d1ae1a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+6
-5
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+1
-1
No files found.
go/zodb/storage/fs1/filestorage.go
View file @
65c9a383
...
...
@@ -96,10 +96,10 @@ type FileStorage struct {
txnhMin
TxnHeader
// transaction headers for min/max transactions committed
txnhMax
TxnHeader
// (both with .Len=0 & .Tid=0 if database is empty)
// driver client <- watcher: data
file update
s.
// driver client <- watcher: data
base commit
s.
watchq
chan
<-
zodb
.
WatchEvent
down
chan
struct
{}
//
ready
when FileStorage is no longer operational
down
chan
struct
{}
//
closed
when FileStorage is no longer operational
downOnce
sync
.
Once
errClose
error
// error from .file.Close()
}
...
...
@@ -444,7 +444,7 @@ func (fs *FileStorage) Iterate(_ context.Context, tidMin, tidMax zodb.Tid) zodb.
// --- watcher ---
// watcher watches updates to .file and notifies
Watch
about new transactions.
// watcher watches updates to .file and notifies
client
about new transactions.
//
// watcher is the only place that mutates index and txnh{Min,Max}.
// XXX ^^^ will change after commit is implemented.
...
...
@@ -452,8 +452,9 @@ func (fs *FileStorage) watcher(w *fsnotify.Watcher) {
defer
w
.
Close
()
// XXX lclose
err
:=
fs
.
_watcher
(
w
)
// it is ok if we got read error due to file being closed
// XXX it can also be ErrFileClosing which is internal
if
e
,
_
:=
errors
.
Cause
(
err
)
.
(
*
os
.
PathError
);
e
!=
nil
&&
e
.
Err
==
os
.
ErrClosed
{
if
e
,
_
:=
errors
.
Cause
(
err
)
.
(
*
os
.
PathError
);
e
!=
nil
&&
(
e
.
Err
==
os
.
ErrClosed
||
// XXX it can also be internal.poll.ErrFileClosing
e
.
Err
.
Error
()
==
"use of closed file"
)
{
select
{
case
<-
fs
.
down
:
err
=
nil
...
...
go/zodb/storage/fs1/filestorage_test.go
View file @
65c9a383
...
...
@@ -359,7 +359,7 @@ func BenchmarkIterate(b *testing.B) {
// var tracef = func(format string, argv ...interface{}) {
// log.Printf("W " + format, argv...)
// }
//
//
// func init() {
// log.SetFlags(log.Lmicroseconds)
// }
...
...
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