solid_queue: silence_polling not working

I have added config.solid_queue.silence_polling = true in my application.rb I have restarted my server after that. But still I am getting logs as following

solid_queue_1  |   SolidQueue::Pause Pluck (1.4ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.6ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (2.1ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.6ms)  COMMIT
solid_queue_1  |   SolidQueue::Pause Pluck (1.4ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.5ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (2.0ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.5ms)  COMMIT
solid_queue_1  |   SolidQueue::Pause Pluck (1.1ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.5ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (1.8ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.5ms)  COMMIT
solid_queue_1  |   SolidQueue::Pause Pluck (1.6ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.7ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (2.7ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.6ms)  COMMIT
solid_queue_1  |   SolidQueue::Pause Pluck (1.7ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.6ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (2.5ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.6ms)  COMMIT
solid_queue_1  |   SolidQueue::Pause Pluck (1.4ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.7ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (2.5ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.7ms)  COMMIT
solid_queue_1  |   SolidQueue::Pause Pluck (1.9ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.7ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (2.6ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.7ms)  COMMIT
solid_queue_1  |   SolidQueue::Pause Pluck (1.6ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.7ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (2.7ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.7ms)  COMMIT
solid_queue_1  |   SolidQueue::Pause Pluck (1.7ms)  SELECT "solid_queue_pauses"."queue_name" FROM "solid_queue_pauses"
solid_queue_1  |   TRANSACTION (0.7ms)  BEGIN
solid_queue_1  |   SolidQueue::ReadyExecution Pluck (2.7ms)  SELECT "solid_queue_ready_executions"."job_id" FROM "solid_queue_ready_executions" ORDER BY "solid_queue_ready_executions"."priority" ASC, "solid_queue_ready_executions"."job_id" ASC LIMIT $1 FOR UPDATE SKIP LOCKED  [["LIMIT", 3]]
solid_queue_1  |   TRANSACTION (0.6ms)  COMMIT
solid_queue_1  |   TRANSACTION (0.3ms)  BEGIN
solid_queue_1  |   SolidQueue::ScheduledExecution Pluck (0.9ms)  SELECT "solid_queue_scheduled_executions"."job_id" FROM "solid_queue_scheduled_executions" WHERE "solid_queue_scheduled_executions"."scheduled_at" <= $1 ORDER BY "solid_queue_scheduled_executions"."scheduled_at" ASC, "solid_queue_scheduled_executions"."priority" ASC, "solid_queue_scheduled_executions"."job_id" ASC LIMIT $2 FOR UPDATE SKIP LOCKED  [["scheduled_at", "2024-04-04 05:11:28.597874"], ["LIMIT", 500]]
solid_queue_1  |   TRANSACTION (0.2ms)  COMMIT

Is there anything else I need to do?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 23 (13 by maintainers)

Most upvoted comments

Since this topic is under discussion, I’ve long been curious about the heartbeat queries and whether those should have been silenced as well. Are these to be expected, or should they have been silenced along with all the other queries?

image

I’m surprised now that it doesn’t work, though! 😆 I’ll dig a bit more.

Aha, yes, it’s expected. The reason is that #silence simply overrides the log level with error (by default), and ActiveSupport::BroadcastLogger sets the local_level for its list of loggers to that level, for the duration of the block, if the logger responds to local_level=, which Logger doesn’t do. So yes, this behaviour using Logger is expected.

I came across this today while fiddling with log configurations. Turns out if you declare the following (as recommended by the Rails guides) then you get Solid Queue polling logs regardless of what you set silence_polling to:

config.logger = Logger.new(STDOUT)

However if you use ActiveSupport::Logger it works as expected:

config.logger = ActiveSupport::Logger.new(STDOUT)

Note you can use TaggedLogging just fine:

  stdout_logger = ActiveSupport::Logger.new(STDOUT)
  tagged_logger = ActiveSupport::TaggedLogging.new(stdout_logger)

  config.log_tags = [ :request_id ]
  config.logger = tagged_logger

Yes, I think silence_queries would work 👍🏻

@rosa One more observation, I created just a new regular app and in that the queries are silenced by default as expected. So I believe the query silencing is not working with dockerized app.

I have this as well. Logging is still present in a Kubernetes/Docker environment.