Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dgraph
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
Container Registry
Model registry
Operate
Environments
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
Mirror
dgraph
Commits
58357679
Unverified
Commit
58357679
authored
8 years ago
by
Manish R Jain
Browse files
Options
Downloads
Patches
Plain Diff
Bug Fix: Set the water reference before putting list in map, otherwise it can be nil causing panic.
parent
70b23918
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
posting/lists.go
+4
-1
4 additions, 1 deletion
posting/lists.go
with
4 additions
and
1 deletion
posting/lists.go
+
4
−
1
View file @
58357679
...
...
@@ -368,7 +368,11 @@ func GetOrCreate(key []byte, group uint32) (rlist *List, decr func()) {
return
lp
,
lp
.
decr
}
// Any initialization for l must be done before PutIfMissing. Once it's added
// to the map, any other goroutine can retrieve it.
l
:=
getNew
(
key
,
pstore
)
// This retrieves a new *List and sets refcount to 1.
l
.
water
=
marks
.
Get
(
group
)
lp
=
lhmap
.
PutIfMissing
(
fp
,
l
)
// We are always going to return lp to caller, whether it is l or not. So, let's
// increment its reference counter.
...
...
@@ -378,7 +382,6 @@ func GetOrCreate(key []byte, group uint32) (rlist *List, decr func()) {
// Undo the increment in getNew() call above.
l
.
decr
()
}
lp
.
water
=
marks
.
Get
(
group
)
pk
:=
x
.
Parse
(
key
)
// This replaces "TokensTable". The idea is that we want to quickly add the
...
...
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