Project

General

Profile

Actions

Bug #18554

closed

application_helper can be slow when invoking authorized_for as non-admin

Added by Chris Duryee about 7 years ago. Updated about 7 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Users, Roles and Permissions
Target version:
-
Fixed in Releases:
Found in Releases:

Description

If you have a non-admin user with rights to view REX jobs, it can be very slow to view the task output. For example:

Rendered /opt/.../app/views/job_invocations/_tab_overview.html.erb (23.2ms)
Rendered /opt/.../app/views/job_invocations/_host_name_td.html.erb (3065.9ms)
Rendered /opt/.../app/views/job_invocations/_host_status_td.html.erb (0.5ms)
Rendered /opt/.../app/views/job_invocations/_host_actions_td.html.erb (3587.1ms)

If you attempt to view the same data as admin, it is fast:

Completed 200 OK in 67ms (Views: 47.9ms | ActiveRecord: 6.9ms)

This problem appears to be very similar to http://projects.theforeman.org/issues/15527.

Actions #1

Updated by The Foreman Bot about 7 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4299 added
Actions #2

Updated by Dominic Cleal about 7 years ago

  • translation missing: en.field_release set to 209

The "fix" seems overly broad, disabling the cache on every single call to authorized_for, not just for this one usage in this one plugin. Every UI that checks one permission for multiple resources will generate substantially more database queries.

(As such, unsuitable for 1.14 point release.)

Actions #3

Updated by Dominic Cleal about 7 years ago

  • Category changed from API to Users, Roles and Permissions
Actions #4

Updated by Chris Duryee about 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #5

Updated by The Foreman Bot about 7 years ago

  • Pull request https://github.com/theforeman/foreman/pull/4315 added
Actions #6

Updated by Marek Hulán about 7 years ago

  • Status changed from Closed to Rejected
  • translation missing: en.field_release deleted (209)

This has been reverted

Actions

Also available in: Atom PDF