Avoid registration and update request handling failure due to profiles handling errors - #1522
Avoid registration and update request handling failure due to profiles handling errors#1522rtamalin wants to merge 3 commits into
Conversation
|
Created as a draft for now while waiting to see if feature tests pass |
|
Feature tests passed so draft has been removed for now... |
1b4ed3d to
51b2cd2
Compare
|
Have been able to test using enhanced |
reduce from what to what? what makes it temporary? |
When the PCT team identified the original bsc#1268305 issue @jesusbv proposed #1494 (corresponding #1506 for rmt_3) to increase the size of the data column to 16MiB from 64KiB. It is temporary because it was only to be used for testing purposes; I don't want to reduce the profiles table data column size permanently as part of implementing this fix. |
@gbuenodevsuse do we have good data on the package profile size? might be relevant to this |
|
That may possibly be an nginx config issue in the RMT deployment... |
| process_system_profiles(create_params) | ||
|
|
||
| @system = System.create!(**create_params) | ||
| # Retry system creation without profiles if initial attempt fails |
There was a problem hiding this comment.
In pubcloud RMTs, the engine overwrites the announce_system methods with it's own version: https://github.com/SUSE/rmt/blob/master/engines/scc_proxy/lib/scc_proxy/engine.rb#L291
So the retry here would not cover it. Maybe extract the retry'ed system create to a shared method?
51b2cd2 to
d00dd3e
Compare
|
Switched this back to draft as I need to work on the issue with the PCT hooking that @digitaltom identified. |
3cf0cea to
39a882a
Compare
e2d0fc5 to
7249884
Compare
jeremy-moffitt
left a comment
There was a problem hiding this comment.
looks ok to me, but someone with more Ruby familiarity should approve before merging
mssola
left a comment
There was a problem hiding this comment.
LGTM in general, just a question on the workflow on system creation.
|
Small comment out of curiosity. I see that you are using tags on your git commit messages like
I'm not telling you to suddenly sign off your commits or anything, just curious by the whole thing 😉 |
So in this regard I was following the recommendation to indicate if AI assistance was used in generating the code in the PR. I avoid letting the AI assistant commit or submit anything though, and review and fix things up before I commit and submit... But yeah I can see the benefit of including a signed off by entry to clearly indicate that I have reviewed the code. So a good practice to assume going forward. |
|
Switching back to draft as my discussion with @mssola identified a viable, likely simpler, alternative approach for the announce_system handling. |
b7da50b to
ef8beb8
Compare
ef8beb8 to
c1a5af9
Compare
As part of annonce_system request handling add support for retrying system record creation without including any complete profiles if an error occurs and profiles were present. Avoid infinite retry loops by skipping retry if profiles weren't provided. Set the reponse header to tell the client to send full profiles next time. As part of update request handling log any errors that occur during the system profiles updates, set the response header indicatingh that clients should send complete profiles next time, and continue with normal processing. Refactored the update request handler to split out the processing of system profiles to a separate routine to address rubocop complexity concerns. Updated spec tests for both announce_system and update requests to exercise the modified processing scenarios. Created placeholder v3.2 entry in the rmt-server.changes to hold a changelog entry for these changes. AI-Assistance-By: Qwen 3.6 35B MoE (A3B) Fixes: SCC-822
This allows the PubCloud engine overrides for the announce_system request handling to leverage it to do the retry without profiles if profiles were provided in the original request. This addresses @digitaltom's review feedback.
Re-work the announce_system request handling for both general and PubCloud deployment scenarios to avoid the need to retry the system entry creation. Instead create!() the system entry without including any detected complete profiles, and then use update!() to update the system entry with any detected complete profiles. If any incomplete or invalid profiles are detected, or if update!() fails to update the profiles in the DB, the response header will be set to indicate that a client needs to send complete profiles next time. Update recently added test descriptions to reflect these changes.
c1a5af9 to
f92d0c9
Compare
|
Removed draft status as generally happy with the updated solution, working on testing the PubCloud aspect of this. |
Description
Rework the announce_system request handling workflow to create the system record first, without including any profiles, and then, if profiles are provided, update the system record with any provided complete profiles. As before, if any issues are identified while processing the profiles the response header will be set. Additionally any failures that occur while updating the system record will be logged, but request processing will continue as normal.
As part of update request handling log any errors that occur during the system profiles updates, set the response header indicating that clients should send complete profiles next time, and continue with normal processing.
Refactored the update request handler to split out the processing of system profiles to a separate routine to address rubocop complexity concerns.
Updated spec tests for both announce_system and update requests to exercise the modified processing scenarios.
Created placeholder v3.2 entry in the rmt-server.changes to hold a changelog entry for these changes.
AI-Assistance-By: Qwen 3.6 35B MoE (A3B)
Fixes: SCC-822
How to test
To assist in testing this scenario I've SUSE/connect-ng's
public-api-demoto add support for specifying profiles via a PROFILES_DIR env var. See public-api-demo/README.md for more details.However, there seems to be a limitation in the
public-api-democommand, or possibly the SUSE/connect-ng client request setup where profiles larger than approx 1MiB in size cause an error when creating the client HTTP request. Therefore test this I had to temporarily reduce the max size of the data field in my local RMT's profiles table to a smaller value to allow me to submit profiles that were too large.Change Type
Please select the correct option.
Checklist
Please check off each item if the requirement is met.
MANUAL.mdfile with any changes to the user experience.package/obs/rmt-server.changes.Review
Please check out our review guidelines
and get in touch with the author to get a shared understanding of the change.