J
J
Julia Kovalenko2017-04-20 10:29:00
MySQL
Julia Kovalenko, 2017-04-20 10:29:00

How to query SphinxSearch in Golang?

Hello!
I'm querying SphinxSearch in Go as described here Go Use Sphinx with Golang .
If this is not done in parallel, then everything works fine!
But requests to the sphinx are sent from goroutines, that is, in parallel.
Literally after 10-15 requests, an error occurs:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x564616]

...
database/sql.(*Rows).Next(0x0, 0xc4203beb00)
...

How can I still send requests to the sphinx in parallel?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Julia Kovalenko, 2017-04-20
@kovalenko_jul_s

The error occurs because too many connections are being created. More precisely, even if there is only one connection, but requests are sent through it in parallel, an error still occurs. Same story with MySql. Even if you make requests not through a tcp socket, but through a unix socket.
The solution is to limit the number of parallel requests.

P
Puma Thailand, 2017-04-20
@opium

well, you have written in the error the pointer is not there or it is zero

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question