-
Notifications
You must be signed in to change notification settings - Fork 900
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
Stopped logging warnings for large queue payload #5393
Stopped logging warnings for large queue payload #5393
Conversation
These messages were not helpful in production mode and also were being triggered at too low a level. The original intent was to find where messages with MBs of data were being saved to the queue. https://bugzilla.redhat.com/show_bug.cgi?id=1274336
What if we just throw it away entirely? @dclarizio ? We still pay the penalty in dev and test every time we put something on the queue because we still have to call YAML.dump on the args. Is this still a useful feature at all? |
To clarify, the original intent was to find that as well as when we put ActiveRecord objects directly on the queue. It turns out that putting objects on the queue happens to be really large, so it covered both cases, particularly when the size was at 512. |
Ah okay, I spoke to @kbrock about it briefly, but still didn't quite understand why we were doing this all the time. I would rather just remove it if we think that this (putting large objects on the queue) isn't happening any more or have a better way to determine when it does. |
I hesitate to encourage it, but there should surely be some only-moderately-hacky mechanism by which we can grab the already-serialized string, instead of re-doing it ourselves... right? |
I was thinking that, but I don't think the object has been serialized yet by the AR model. At a high level, we are essentially here in the flow: q = MiqQueue.new(:args => [some_objects])
# Check the size of the args in q here
q.save! |
Oh no wait, we do a |
Checked commit carbonin@ce1f1a8 with ruby 1.9.3, rubocop 0.34.2, and haml-lint 0.13.0 app/models/miq_queue.rb
spec/models/miq_queue_spec.rb
|
@@ -121,7 +121,7 @@ def self.put(options) | |||
options[:args] = [options[:args]] if options[:args] && !options[:args].kind_of?(Array) | |||
|
|||
msg = MiqQueue.create!(options) | |||
msg.warn_if_large_payload | |||
msg.warn_if_large_payload unless Rails.env.production? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest, I think this is only significant in production.
@Fryguy do you remember the back story on this warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I don't understand why we need to pay the penalty of yaml dump and potentially logging in every queue put. Even if we have the yaml string, let's figure out what this log message solves. Do we really care about the size or do we really care how long it takes to create or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See ☝️ #5393 (comment)
Thanks, I didn't know about this secondary concern. If this is test/development only, should we blow up instead of warn? |
So I found this which looks like it should do what we want in terms of getting rid of I did a quick test with the queue specs and this is what I'm seeing where (byebug) db_msg = MiqQueue.find(msg.id)
#<MiqQueue:0x0055a2bd159108>
(byebug) db_msg == msg
true
(byebug) msg.args_before_type_cast
1
2
3
4
5
(byebug) msg.args_before_type_cast.class
Array
(byebug) db_msg.args_before_type_cast
---
- 1
- 2
- 3
- 4
- 5
(byebug) db_msg.args_before_type_cast.class
String So it looks like our options are calling back to the database or changing the |
I had played with Why are we doing this? Is there a way to get our needs met and avoid this check?
|
@dclarizio Need your opinion here. |
Looks like this was added in 08ddbec6f5dd0efcba - the comment doesn't describe why the check was added. So the open question is whether we need it. Also, whether we want to allow an active record object to go into the queue, or if we want to blow up on the prospect. (e.g. use |
@dclarizio Sorry for the pings...I really confused session size check with queue size checks. Just to give info on the commit in case we ever come back to this ticket
At this point, I'm thinking that if we can get the size from the "should have already been serialized on create" string in the |
I'm leaning towards throwing this away. Note, |
@Fryguy #5393 (comment) was my attempt to get the serialized args out of |
Hoping for this. I found |
@Fryguy where did we land on this? Is |
Or we could still just get rid of it entirely ... |
I vote removing it |
✂️ 🔥 ✂️ 🔥 ✂️ 🔥 ✂️ 🔥 ✂️ 🔥 |
Alternative PR here: #5716 |
Closing in favor of #5716 |
yay |
These messages were not helpful in production mode
and also were being triggered at too low a level.
The original intent was to find where messages with
MBs of data were being saved to the queue.
https://bugzilla.redhat.com/show_bug.cgi?id=1274336
@jrafanie @kbrock