Repository navigation
Closed
Description
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?
Reacted by Brent Lintner, Konstantin Mochalov and Mark R. James
Metadata
Metadata
Assignees
Labels
No labels
Activity
rosa commentedon Apr 4, 2024
Hey @anandbait, no, that should be all 😕 It's very strange it doesn't work for you. Looks like you're using Docker? Is it possible you didn't restart the supervisor there correctly? Or that you're looking at old logs? 😕
bronzdoc commentedon Apr 5, 2024
I'm experiencing the same issue and I'm also using Docker
rosa commentedon Apr 5, 2024
Hey @bronzdoc, are you making sure everything is restarted correctly? Could you share a bit more about your setup? For example, your Dockerfile?
bronzdoc commentedon Apr 5, 2024
@rosa Yes, I have restarted the services multiple times.
I have a service in my docker-compose.yml like this
solid_queue version: 0.3.0
Docker version: 24.0.6, build ed223bc
Docker Compose version: 24.0.6, build ed223bc
And in
config/application.rbI addedconfig.solid_queue.silence_polling = truewflanagan commentedon Apr 5, 2024
I have this as well. Logging is still present in a Kubernetes/Docker environment.
anandbait commentedon Apr 7, 2024
I have similar setup as @bronzdoc
I restarted docker-compose so the setup should reflect right?
@rosa Can you confirm that while we talk about "polling queries" then those are same queries which I have posted in logs or some other queries?
rosa commentedon Apr 7, 2024
Yes, it's exactly those queries that you have posted, the ones that should be silenced. Something must be broken 🤔 We did change the default from
falsetotruefor that setting very recently, but that shouldn't have broken it 😕 I'll dig into it.namolnad commentedon Apr 7, 2024
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?
rosa commentedon Apr 10, 2024
Oh, @namolnad, good question. Those weren't intended to be suppressed with this setting because they're not polling queries or related to polling 🤔 Perhaps the
silence_pollingsetting should be generalized to include those queries, with a different, more generic name 🤔anandbait commentedon Apr 10, 2024
@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.
rosa commentedon Apr 10, 2024
Thanks @anandbait! That was my suspicion as well, as silencing the queries is working fine for us in several cases 😕
It's really weird that Docker would play a role here! I need to dig more.
namolnad commentedon Apr 10, 2024
Ahh that makes sense re: the
silence_pollingname and intention. Unsure people generally feel this way, but I know I'd be on board for a more generalized name/setting to silence those additional queries (I receive a few complaints from my team from time to time :)). Perhaps justsilent = trueorsilence_queries = truewould convey the meaning adequately?rosa commentedon Apr 10, 2024
Yes, I think
silence_querieswould work 👍🏻jroes commentedon Apr 13, 2024
Also seeing this behavior, and not running in Docker. I do have a few different things that are plugging into the logging system that might be interfering. I'm on 0.3.0 of the gem, and I have tried both true and false for the config in my application.rb file:
And this is the logging output I'm observing:
(Running via overmind in this example but same behavior when running standalone)
jroes commentedon Apr 13, 2024
Sorted it out on my end, in my development.rb I had:
Removing that fixed things for me. As a minor note in case others are unaware,
bin/rails swill print logs to stdout, but running puma directly will not.namolnad commentedon Apr 13, 2024
@rosa I've separated this work into another issue to keep this one focused on the other (seemingly docker-related) problem. New issue here: #210
rbarrera87 commentedon Jun 27, 2024
In my case the logs are not being shown in the container logs, however, I am able to bash the container and tail the logs there.
lylo commentedon Sep 16, 2024
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_pollingto:However if you use
ActiveSupport::Loggerit works as expected:Note you can use
TaggedLoggingjust fine:rosa commentedon Sep 16, 2024
Oh, that makes sense, I suppose, because
#silenceis provided by Active Support 🤔 But I'm surprised you don't get an error, though...rosa commentedon Sep 16, 2024
Ahhh, you don't because Rails internally uses
ActiveSupport::BroadcastLogger, that broadcasts to a list of loggers, in this case just withLogger.new(STDOUT). I'm surprised now that it doesn't work, though! 😆 I'll dig a bit more.rosa commentedon Sep 16, 2024
Aha, yes, it's expected. The reason is that
#silencesimply overrides the log level witherror(by default), andActiveSupport::BroadcastLoggersets thelocal_levelfor its list of loggers to that level, for the duration of the block, if the logger responds tolocal_level=, whichLoggerdoesn't do. So yes, this behaviour usingLoggeris expected.jlvallelonga commentedon Oct 18, 2024
added a PR for an option to silence the heartbeat logging #389. In the meantime, we're using a patch to silence these in HostedGPT: (https://github.com/AllYourBot/hostedgpt/blob/main/config/initializers/solid_queue_extension.rb)
rosa commentedon Jan 16, 2025
Going to close this one as it seems the issue with
silence_pollingnot working was already explained in #198 (comment)Generalize silence_polling to silence_queries