GithubHelp home page GithubHelp logo

Comments (3)

sigmaray avatar sigmaray commented on September 17, 2024

I forgot to mention. If I understood correctly, Sidekiq processes freeze on this line

19:39:59 jobs-2.1        | 2024-08-26T16:39:59.228Z pid=14 tid=4ge WARN:
[...]/activerecord-7.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:862:in `set_client_encoding'

It seems that set_client_encoding method doesn't respect timeot specified in database.yml

My guess could be wrong. I don't have experience of reading sidekiq traces.

from ruby-pg.

larskanis avatar larskanis commented on September 17, 2024

There was a previous issue regarding to encoding through a connection proxy: #368

It is resolved since pg-1.5.4. But looking into the ActiveRecord sources, it looks like you're actively triggering this command by setting :encoding in your database config. Can you disable this config option?

from ruby-pg.

drdrsh avatar drdrsh commented on September 17, 2024

I ran into a similar issue where timeouts/interrupts are sometimes not honored by ruby-pg. I was never able to reproduce the issue in a controlled environment but it was happening in production.

The fix was to set keepalives and tcp_user_timeout on the sockets.

postgres://username:password@host:port/database?connect_timeout=2&keepalives=1&keepalives_idle=1&keepalives_count=1&tcp_user_timeout=1000

I don't know if this is related in anyway but using these settings we were able to eliminate the frozen thread occurrences

from ruby-pg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.