Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout before ending when query simultaneously #68

Open
alexandre-sullet-cko opened this issue Jun 1, 2020 · 0 comments
Open

Timeout before ending when query simultaneously #68

alexandre-sullet-cko opened this issue Jun 1, 2020 · 0 comments

Comments

@alexandre-sullet-cko
Copy link

Hello,

Either I missed something, either there is possibly a behavioural bug.

I'm trying to run 5 simultaneous queries with QueryPipeline just like like below. The thing is when I run queries independently, it works but for faster speed, I need it to parallelised them.
I tried several options like go routine, with one connection and it doesn't work, I tried with the pool connection and it was still really slow because needed to create multiple connections and then I tried with Query Pipeline, the thing is when the result is empty, it just doesn't end (Like it's waiting for timeout of 1min). Plus it doesn't show the result of the queries that are after.

Here the example:

I have 4 queries :

query_1 that returns 7,
query_2 that returns 257,
query_3 that returns nothing (no match found),
query_4 that returns nothing (no match found)

pipeline, err := con.PreparePipeline(
	query_1,
        query_2,
        query_3,
        query_4,
)
handleError(err)

pipelineRows, err := pipeline.QueryPipeline(nil, nil, nil, nil, nil)

result, _, _, err := pipelineRows.NextPipeline()
fmt.Println("result 1")
spew.Dump(result) // <= gives 7 so okay
_, _, pipelineRows, err = pipelineRows.NextPipeline()
result, _, _, err = pipelineRows.NextPipeline()
fmt.Println("2 res")
spew.Dump(result) // <= gives 257 so okay
_, _, pipelineRows, err = pipelineRows.NextPipeline()
result, _, _, err = pipelineRows.NextPipeline()
fmt.Println("3 res")
spew.Dump(result) // <= gives nothing so okay
_, _, pipelineRows, err = pipelineRows.NextPipeline() // looks like it's stuck here because it was empty so can't have the result of the last query
result, _, _, err = pipelineRows.NextPipeline() // or stuck here maybe ?
fmt.Println("4 res")
spew.Dump(result) // <= can't have the result
_, _, pipelineRows, err = pipelineRows.NextPipeline()

So, do you have any insight on how to parallelize queries that way please ?
Or help me get the results of the last queries please ?

P.S. I checked every err and they're all empty

Also if the result of the 1st query is empty, I don't have the result of the second and others that are right after.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant