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
AutomationEngine mutex methods #6577
Conversation
|
@dtrieu80 Please rebase and push again |
|
@gmcculloug @mkanoor Please review |
| ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[Rails.env]) | ||
| end | ||
| unless @connection | ||
| @connection = ActiveRecord::Base.connection |
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.
@dtrieu80
@connection ||= ActiveRecord::Base.connection
|
@dtrieu80 |
|
@matthewd Can you review...particularly the PgConcurrency bit? |
| while Time.now < give_up_at do | ||
| if MiqConcurrency::PGMutex.try_advisory_lock(lock_name) | ||
| begin | ||
| yield |
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.
return yield; it's good form for a with_... method to return its block's result
this adds support for manual api auth token invalidation, via the DELETE /api/auth action (with a valid X-Auth-Token HTTP header) the token is deleted and a 204 response is returned (if no such token exists, the token validity check kicks in and returns a 401)
Plus add stub functions for __() and N_() into tests and turn off jshint warnings for them.
Callers of collect_children expect arrays. Fixes: ``` undefined method `empty?' for #<Host:0x007f9dbdbd9dd8> /~/.gem/ruby/2.2.4/gems/activemodel-4.2.5.1/lib/active_model/attribute_methods.rb:433:in `method_missing' ./app/models/condition.rb:165:in `_subst_find' ```
…chkconfig` LinuxAdmin::Service will detect if it should call `service` or `systemctl` commands when an instance is created. This makes it more portable than unconditionally using `service` and `chkconfig`.
Also, specify the source_type as rails requests. Note, we specify VmOrTemplate here because VmOrTemplate is where this has_many is located. It seems like this has_many may belong in MiqTemplate. Fixes the following error: ``` ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :vm in model MiqProvision. Try 'has_many :miq_provision_vms, :through => :miq_provisions_from_template, :source => <name>'. Is it one of miq_request, source, destination, miq_request_tasks, miq_request_task, or tenant? ``` This resolves the model bug reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1303074 We still need to see if we can generate reports based on this now fixed has_many :through.
|
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
|
<github_pr_commenter_batch />Some comments on commits https://github.com/dtrieu80/manageiq/compare/e2ed2f4fec3f122095b65b10c934746fd1dcaf1d~...5654aedaa530ba5b8f648aea663233be9273e2b2 |
|
Checked commits https://github.com/dtrieu80/manageiq/compare/e2ed2f4fec3f122095b65b10c934746fd1dcaf1d~...5654aedaa530ba5b8f648aea663233be9273e2b2 with ruby 2.2.3, rubocop 0.34.2, and haml-lint 0.13.0 Gemfile
app/controllers/application_controller.rb
app/controllers/application_controller/ci_processing.rb
app/controllers/application_controller/compare.rb
app/controllers/application_controller/filter.rb
app/controllers/auth_key_pair_cloud_controller.rb
app/controllers/ems_common.rb
app/controllers/miq_policy_controller/rsop.rb
app/controllers/miq_request_controller.rb
app/controllers/provider_foreman_controller.rb
app/controllers/report_controller.rb
app/controllers/report_controller/reports/editor.rb
app/controllers/vm_common.rb
app/helpers/application_helper.rb
app/helpers/persistent_volume_helper/textual_summary.rb
app/models/cloud_volume/operations.rb
app/models/ems_cluster.rb
app/models/ems_refresh/save_inventory_configuration.rb
app/models/host.rb
app/models/import_file_upload.rb
app/models/manageiq/providers/ansible_tower/configuration_manager/refresh_parser.rb
app/models/manageiq/providers/azure/cloud_manager/provision/cloning.rb
app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb
app/models/manageiq/providers/google/cloud_manager/provision/cloning.rb
app/models/manageiq/providers/openstack/cloud_manager/provision_workflow.rb
app/models/manageiq/providers/openstack/cloud_manager/refresh_parser.rb
app/models/manageiq/providers/openstack/cloud_manager/vm/operations/relocation.rb
app/models/miq_action.rb
app/models/orchestration_template.rb
app/models/rbac.rb
app/models/service.rb
app/models/storage.rb
app/models/vm_or_template.rb
app/presenters/menu/default_menu.rb
app/services/container_dashboard_service.rb
app/services/container_topology_service.rb
app/views/configuration/_ui_2.html.haml
app/views/layouts/_content.html.haml
app/views/shared/views/_prov_dialog.html.haml
config/initializers/rack_ruby_prof.rb
config/initializers/sprockets-es6.rb
config/routes.rb
db/fixtures/ae_datastore/ManageIQ/Infrastructure/VM/Provisioning/StateMachines/VMProvision_Template.class/methods/update_provision_status.rb
db/migrate/20150914202922_correct_user_created_role_feature_sets.rb
gems/pending/Gemfile
gems/pending/OpenStackExtract/MiqOpenStackVm/MiqOpenStackCommon.rb
gems/pending/OpenStackExtract/MiqOpenStackVm/MiqOpenStackImage.rb
gems/pending/OpenStackExtract/MiqOpenStackVm/MiqOpenStackInstance.rb
gems/pending/VMwareWebService/MiqVimInventory.rb
gems/pending/VMwareWebService/VimPropMaps.rb
gems/pending/VMwareWebService/wsdl41/vimws25MappingRegistry.rb
gems/pending/VolumeManager/MiqLvm.rb
gems/pending/appliance_console/internal_database_configuration.rb
gems/pending/spec/util/miq_logger_processor_spec.rb
lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-azure-cloud_manager-provision.rb
lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-google-cloud_manager-provision.rb
lib/miq_concurrency.rb
lib/token_manager.rb
spec/automation/unit/method_validation/update_provision_status_vm_cloud_spec.rb
spec/automation/unit/method_validation/update_provision_status_vm_infra_spec.rb
spec/automation/unit/method_validation/update_provision_status_vm_template_infra_spec.rb
spec/automation/unit/method_validation/update_service_provision_status_orchestration_spec.rb
spec/factories/availability_zone.rb
spec/factories/ext_management_system.rb
spec/factories/security_group.rb
spec/factories/template_google.rb
spec/factories/vm_or_template.rb
spec/helpers/application_helper/toolbar_builder_spec.rb
spec/lib/miq_automation_engine/miq_ae_collect_spec.rb
spec/lib/miq_automation_engine/miq_ae_provision_spec.rb
spec/lib/miq_automation_engine/miq_ae_service_spec.rb
spec/lib/miq_automation_engine/service_methods/miq_ae_service_manageiq-providers-cloud_manager-provision_spec.rb
spec/lib/miq_automation_engine/service_methods/miq_ae_service_manageiq-providers-cloud_manager-vm_spec.rb
spec/lib/miq_automation_engine/service_methods/miq_ae_service_manageiq-providers-google-cloud_manager_spec.rb
spec/lib/vmdb/configuration_encoder_spec.rb
spec/migrations/20150604154825_rename_container_node_conditions_to_container_conditions_spec.rb
spec/migrations/20151204143045_set_correct_sti_type_on_openstack_cloud_volume_spec.rb
|
|
...continued
spec/models/condition_spec.rb
spec/models/host_spec.rb
spec/models/manageiq/providers/amazon/aws_helper.rb
spec/models/manageiq/providers/amazon/cloud_manager_spec.rb
spec/models/manageiq/providers/ansible_tower/configuration_manager/refresh_parser_spec.rb
spec/models/manageiq/providers/azure/cloud_manager/provision_spec.rb
spec/models/manageiq/providers/azure/cloud_manager/refresher_spec.rb
spec/models/manageiq/providers/openshift/container_manager/refresher_spec.rb
spec/models/manageiq/providers/openstack/cloud_manager/provision_workflow_spec.rb
spec/models/miq_report_spec.rb
spec/models/miq_storage_metric_spec.rb
spec/support/automation_spec_helper.rb
tools/log_processing/ems_refresh_timings.rb
|
|
I messed up this branch somehow. I'll need to close it and reapply a new PR. |
|
@dtrieu80 ping us in https://gitter.im/ManageIQ/manageiq if you need help. Thanks! |
|
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
New methods introduced:
$evm.with_acquired_lock(lock_name)
$evm.acquire_lock(lock_name)
$evm.release_lock(lock_name)
$evm.has_lock?(lock_name)
Need to consider deadlock solutions (lock ordering, no-nested or one-lock at a time, etc).