-
Notifications
You must be signed in to change notification settings - Fork 898
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
[Bug] Cannot eagerly load the polymorphic association :resource in performance report #19664
Comments
@miq-bot add_label bug |
fun stuff: # fails
MetricRollup.includes(:resource, :time_profile).references("time_profiles").first
# works
MetricRollup.preload(:resource).includes(:time_profile).references("time_profiles").first
MetricRollup.includes(:resource).first
MetricRollup.includes(:time_profile).references("time_profiles").first
MetricRollup.preload(:resource, :time_profile).includes(:time_profile).references("time_profiles").first
# NEW:
# works
MetricRollup.preload(:resource, :time_profile).eager_load(:time_profile).first
reproducer coded up in master...kbrock:polymorphic_through |
Similar problem from the UI side. Go to Compute --> Infra --> VMs A task is fired at this point through the queue. And the task will fail with a stacktrace in the EVM log. Unfortunately there's no error handling for the failed task so the UI will end up in an infinite busy-wait loop.
|
@kbrock I'm kinda blocked by this 😕 in resolving ManageIQ/manageiq-ui-classic#6534 |
@kbrock @NickLaMuro what is the status of this issue? |
@chessbyte sorry for the lack of a follow up on here, but #19804 should have fixed this issue. |
@NickLaMuro can you validate the reproducer here is addressed. |
@chessbyte the specs that were added from the PR should do just that:
@kbrock since you wrote those specs, can you sanity check me on that claim? |
@chessbyte @NickLaMuro Yes, The report spec is the reproducer from Libor. |
@kbrock @NickLaMuro so can this issue be closed as resolved? |
@lpichler is this issue fixed? |
@chessbyte For what it is worth, I have asked David to test it out in gitter: https://gitter.im/ManageIQ/manageiq?at=5e3c3b58dc52c34ace4d01f2 And he said that it fixed his issue as well. |
It fixed the issue I was experiencing. |
Reproducer:
replace
context "performance reports"
in./spec/models/miq_report_spec.rb
run and then you will get error message:
polymorphic association :resource in performance report
this error is also in UI(toolbar button
Monitoring -> Utilization on VM summary screen
) when those yaml are used:Caused by
most likely by #19127
and issue is only on upstream (no on ivanchuck, no on hammer )
I am not sure about proper fix but it looks we need to somehow include this condition
https://github.com/ManageIQ/manageiq/pull/19127/files#diff-8d948055de14ced0e63abf9637a9a788L415
Feel free to use my spec in your PR.
@kbrock as you author of the #19127 maybe you will know better how to fix it.
cc @NickLaMuro
thanks !
The text was updated successfully, but these errors were encountered: