Comments (4)
Hello @derekperkins,
I couldn't manage to reproduce the problem. It's very likely there is a nil item in the list of commands. pipe
cannot be nil. I reviewed the code. I couldn't find any reason for nil commands. There can be a subtle bug in the command pool logic. Do you use Discard
?
func (dp *DMapPipeline) execOnPartition(ctx context.Context, partID uint64) error {
rc, err := dp.dm.clusterClient.clientByPartID(partID)
if err != nil {
return err
}
// There is no need to protect dp.commands map and its content.
// It's already filled before running Exec, and it's now a read-only
// data structure
commands := dp.commands[partID]
pipe := rc.Pipeline()
for _, cmd := range commands {
pipe.Do(ctx, cmd.Args()...) --> panics
}
Could you share a code snippet to reproduce the problem?
from olric.
Here is my hypothesis:
execOnPartition
assumes that dp.commands
is read-only during the execution. Neither dp.commands
nor its content is protected by a mutex during the execution. If your code calls Exec
and Discard
simultaneously, execOnPartition
may encounter nil items in dp.commands
.
Discard
calls dp.closedCancel()
at line 548, if Exec
is already passed the context check at line 503, they can start running parallel.
from olric.
Yes, we're using Discard and reusing pipelines, but we're not calling Exec and Discard simultaneously on our own accord. This is simplified, but basically this is what we're doing.
defer pipeline.Discard()
pipeline.Exec(ctx)
for _, futureGet := range futureGets {
futureGet.Result().Scan()
}
I'm wondering if there's a race condition when context is canceled...
from olric.
I'm wondering if there's a race condition when context is canceled...
I believe the possible root cause is this.
from olric.
Related Issues (20)
- more flexible encoder to support proto / json payloads HOT 3
- pipelining 100x slower on cache misses HOT 10
- panic: semaphore: released more than held HOT 1
- pipeline concurrency hardcoded to 1
- reduce pipeline.Discard allocations HOT 1
- Possible pipeline.Discard bug HOT 1
- Unbounded memory growth / leak in pipelines HOT 4
- panic: runtime error: integer divide by zero in setLRUEvictionStats HOT 1
- panic on args HOT 1
- Panic on start when BindAddr cannot be resolved
- Data race when getting stats in embedded mode
- remove dtopic listener didn't work well in cluster mode
- DNS based service discovery HOT 8
- Fast restart will cause data lost HOT 1
- Flaky integration test
- Using olric from PHP programs HOT 3
- storage overhead per object HOT 3
- Allow developer to pass his/her logging framework of choice HOT 9
- Use of DM Lock with Embedded Member HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from olric.