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

ThinkingSphinx::ConnectionError - Error connecting to Sphinx via the MySQL protocol. Lost connection to server during query #1266

Open
madmax opened this issue Nov 9, 2024 · 1 comment

Comments

@madmax
Copy link

madmax commented Nov 9, 2024

After upgrading to recent manticore search and going to docker version https://hub.docker.com/r/manticoresearch/manticore/ (6.3.6) i get sometimes error

ThinkingSphinx::ConnectionError

Error connecting to Sphinx via the MySQL protocol. Lost connection to server during query - SELECT *, WEIGHT() as rank FROM `movie_search_0_core`, `movie_search_1_core`, `movie_search_2_core`, `movie_search_3_core` WHERE MATCH('@(titles,year_index) _begin o que podem as palavras _end') AND `sphinx_deleted` = 0 ORDER BY `rank` DESC, `popular` DESC LIMIT 0, 20 OPTION cutoff=0, field_weights=(titles=20, year_index=1), ranker=proximity; SHOW META

Checked server and there is no crash for manticore. It happens very rarely. Any idea how debug this kind of errors?
I know there is Retrying query mechanism but untill but only works for ThinkingSphinx::QueryExecutionError not for ThinkingSphinx::ConnectionError.

Running the same query again works fine. It looks like this has nothing connected to specific query.

@madmax
Copy link
Author

madmax commented Nov 9, 2024

ThinkingSphinx::ConnectionError actually make query retry. Increased retry times from 3 to 10. But was wondering how often this retry is used. I subscribe message.thinking_sphinx and logs in sentry.

ActiveSupport::Notifications.subscribe("message.thinking_sphinx") do |event|
  if event.payload[:message] && event.payload[:message].match?(/^Retrying query/)
    Sentry.set_extras(attributes: event.payload)
    Sentry.capture_message("Error Sphinx query")
  end
end

It's normal that this happens so often? For normal mysql connection there is no retry mechanism and I can't see this kind of errors. Also turned on debugging on manticoresearch but there is no information that something is wrong when ost connection to server during query appears.

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