Comments (3)
v0.34.0 shows the same behavior.
from go-cloud.
I'd try adding some logging near here: https://github.com/google/go-cloud/blob/master/docstore/mongodocstore/query.go#L124 to see if you can determine where the pauses are coming from. I am also not familiar with the docstore/mongodocstore code, but it looks like we're just iterating calling cursor.Next and then decoding it.
from go-cloud.
Thank you for the pointer. After some more debugging and some dead ends i think i understand whats happening. Especially the golang trace is helpful:
The green-pink-brown stacks are io operations (syscall.read from within go.mongodb.org/mongo-driver/mongo.(*Cursor).Next:133).
The light blue stacks are decode operations (gocloud.dev/docstore/mongodocstore.decodeDoc:125).
I would have expected the documents to be decoded from the moment the first element of a batch arrives. But it seems the mongo driver waits for the complete batch to arrive. Thereafter the gocloud decode operation is applied to all elements and only then the next batch is requested. That explains the above pattern in the io graph.
Not much that can be done about it. Using func (c *Cursor) TryNext(ctx context.Context) bool
as a noneblocking alternative could be feasible. This would allow decoding to continue while the next batch is already in flight. But that would require at least parallelized code.
Thanks for having a look and helping me understand the issue.
from go-cloud.
Related Issues (20)
- runtimevar: support `env` url HOT 2
- blob/azureblob: Using a SAS token results in "Signature fields not well formed" HOT 3
- Using AWS, how do we enable compression and decompression of upload and dwonload? HOT 5
- blob/s3: Support Server Side encryption settings in bucket url HOT 2
- docstore/gcpfirestore: ought to support non-default databases HOT 4
- S3 Blob Incompatibility with AWS S3 Issues? HOT 3
- docstore: should support (in) comparison operator HOT 3
- pubsub: support NATS jetstream HOT 1
- pubsub/awssnssqs: duplicate key in map literal HOT 3
- blob/s3: Add content length parameter in signing URL HOT 3
- pubsub/azuresb: support workload identity auth method HOT 3
- secrets/hashivault: read token from file HOT 3
- pubsub/azuresb: sending a message when unauthorized hangs HOT 1
- New Project: Docstore Query Gen for Go CDK HOT 1
- RabbitPubSub Queue Connection Closes Unexpectedly with FailedPrecondition Error HOT 2
- all: Request for new tag including 'Offset' feature in docstore HOT 1
- docstore/mongodocstore: Error update with only unset or increment modifier (recurring issue)
- pubsub/ AWS MSK Support HOT 6
- blob/s3blob: url encode CopySource
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 go-cloud.