Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-merkledag
Commits
3b8c0ad4
Commit
3b8c0ad4
authored
Nov 27, 2018
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a fetch deadlock on error
fixes
https://github.com/ipfs/go-ipfs/issues/5793
parent
ff7c0709
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
merkledag.go
merkledag.go
+4
-1
merkledag_test.go
merkledag_test.go
+5
-0
No files found.
merkledag.go
View file @
3b8c0ad4
...
...
@@ -397,7 +397,10 @@ func EnumerateChildrenAsyncDepth(ctx context.Context, getLinks GetLinks, c cid.C
if
shouldVisit
{
links
,
err
:=
getLinks
(
ctx
,
ci
)
if
err
!=
nil
{
errChan
<-
err
select
{
case
errChan
<-
err
:
case
<-
fetchersCtx
.
Done
()
:
}
return
}
...
...
merkledag_test.go
View file @
3b8c0ad4
...
...
@@ -677,6 +677,7 @@ func TestEnumerateAsyncFailsNotFound(t *testing.T) {
b
:=
NodeWithData
([]
byte
(
"foo2"
))
c
:=
NodeWithData
([]
byte
(
"foo3"
))
d
:=
NodeWithData
([]
byte
(
"foo4"
))
e
:=
NodeWithData
([]
byte
(
"foo5"
))
ds
:=
dstest
.
Mock
()
for
_
,
n
:=
range
[]
ipld
.
Node
{
a
,
b
,
c
}
{
...
...
@@ -703,6 +704,10 @@ func TestEnumerateAsyncFailsNotFound(t *testing.T) {
t
.
Fatal
(
err
)
}
if
err
:=
parent
.
AddNodeLink
(
"e"
,
e
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
err
:=
ds
.
Add
(
ctx
,
parent
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
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