Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 910869 Details for
Bug 1044122
Batch processing vs. reboot: fix possible reboot loop and the clutter from when batch processing gets interrupted
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch to make reboot loop as unlikely as possible
bz1044122.patch (text/plain), 3.24 KB, created by
Jan Pokorný [poki]
on 2014-06-20 18:35:08 UTC
(
hide
)
Description:
Proposed patch to make reboot loop as unlikely as possible
Filename:
MIME Type:
Creator:
Jan Pokorný [poki]
Created:
2014-06-20 18:35:08 UTC
Size:
3.24 KB
patch
obsolete
>--- ricci-0.16.2/common/Module.cpp.orig 2014-06-20 19:39:39.307822075 +0200 >+++ ricci-0.16.2/common/Module.cpp 2014-06-20 20:00:45.431113310 +0200 >@@ -75,6 +75,20 @@ > {} > > XMLObject >+Module::empty_response(const String& version, const String& seq_tag, const String& fcn_name) >+{ >+ XMLObject response(RESPONSE_TAG); >+ response.set_attr(MOD_VERSION_TAG, version); >+ response.set_attr(SEQUENCE_TAG, seq_tag); >+ >+ XMLObject func_resp_xml(FUNC_RESPONSE_TAG); >+ func_resp_xml.set_attr("function_name", fcn_name); >+ >+ response.add_child(func_resp_xml); >+ return response; >+} >+ >+XMLObject > Module::process(const XMLObject& request) > { > try { >@@ -103,12 +117,10 @@ > } > > // construct response xml >- XMLObject response(RESPONSE_TAG); >- response.set_attr(MOD_VERSION_TAG, version); >- response.set_attr(SEQUENCE_TAG, request.get_attr(SEQUENCE_TAG)); >- >- XMLObject func_resp_xml(FUNC_RESPONSE_TAG); >- func_resp_xml.set_attr("function_name", fcn_name); >+ XMLObject& response = empty_response(version, >+ request.get_attr(SEQUENCE_TAG), >+ fcn_name); >+ XMLObject& func_resp_xml = response.children().front(); > > try { > map<String, Variable> in_vars = extract_vars(func_xml); >@@ -135,7 +147,6 @@ > func_resp_xml.add_child(Variable("error_description", > String("No description")).xml()); > } >- response.add_child(func_resp_xml); > return response; > } catch ( APIerror e ) { > XMLObject err_resp("API_error"); >--- ricci-0.16.2/include/Module.h.orig 2014-06-20 20:02:25.613455041 +0200 >+++ ricci-0.16.2/include/Module.h 2014-06-20 20:03:25.424659112 +0200 >@@ -1,5 +1,5 @@ > /* >-** Copyright (C) Red Hat, Inc. 2006-2009 >+** Copyright 2014 Red Hat, Inc. > ** > ** This program is free software; you can redistribute it and/or modify it > ** under the terms of the GNU General Public License version 2 as >@@ -44,6 +44,7 @@ > { > public: > virtual ~Module(); >+ virtual XMLObject empty_response(const String& version, const String& seq_tag, const String& fcn_name); > virtual XMLObject process(const XMLObject& request); > > protected: >--- ricci-0.16.2/ricci/RicciWorker.cpp.orig 2014-06-20 20:03:59.393775026 +0200 >+++ ricci-0.16.2/ricci/RicciWorker.cpp 2014-06-20 20:31:05.245541488 +0200 >@@ -1,5 +1,5 @@ > /* >-** Copyright (C) Red Hat, Inc. 2005-2009 >+** Copyright 2014 Red Hat, Inc. > ** > ** This program is free software; you can redistribute it and/or modify it > ** under the terms of the GNU General Public License version 2 as >@@ -175,15 +175,25 @@ > > try { > XMLObject request = _report.children().front(); >- XMLObject mod_resp; >+ XMLObject tmp_resp, mod_resp; > > if (module_name == "reboot") { >+ /* temporarily "remove from scheduler" and checkpoint >+ this state; to prevent reboot loop (rhbz#1044122) */ >+ tmp_resp = _rm.empty_response("1.0", >+ request.get_attr(SEQUENCE_TAG), >+ "reboot_now"); >+ module_header.add_child(tmp_resp); >+ _report = module_header; >+ _state = st_removed; >+ _batch.save(); >+ > mod_resp = _rm.process(request); > if (_rm.block() && check_response(mod_resp)) { > if (mod_resp.tag() == "internal_error") > throw int(); >- module_header.add_child(mod_resp); >- _report = module_header; >+ _report.remove_child(tmp_resp); >+ _report.add_child(mod_resp); > _state = st_done; > _batch.save(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1044122
:
910869
|
914749