From 8de7f2349af86312395e10b46369662fc776e90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Thu, 29 Jan 2026 09:49:10 +0000 Subject: [PATCH 1/4] Do not wait when sending SetConfig to storage --- rust/agama-manager/src/service.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rust/agama-manager/src/service.rs b/rust/agama-manager/src/service.rs index 77a1eacd35..ba160e8ad6 100644 --- a/rust/agama-manager/src/service.rs +++ b/rust/agama-manager/src/service.rs @@ -463,12 +463,10 @@ impl Service { .call(iscsi::message::SetConfig::new(config.iscsi.clone())) .await?; - self.storage - .call(storage::message::SetConfig::new( - Arc::clone(product), - config.storage.clone(), - )) - .await?; + self.storage.cast(storage::message::SetConfig::new( + Arc::clone(product), + config.storage.clone(), + ))?; // call bootloader always after storage to ensure that bootloader reflect new storage settings self.bootloader From 76789410a03b3965a269820d89c4e1c2e1d266e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Thu, 29 Jan 2026 09:54:32 +0000 Subject: [PATCH 2/4] Retry to connect to the web server --- service/lib/agama/http/clients/base.rb | 39 ++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/service/lib/agama/http/clients/base.rb b/service/lib/agama/http/clients/base.rb index 84804671fa..afe27cb842 100644 --- a/service/lib/agama/http/clients/base.rb +++ b/service/lib/agama/http/clients/base.rb @@ -37,7 +37,9 @@ def initialize(logger) # @param path [String] path relatived to `api`` endpoint. # @param data [#to_json] data to send in request def post(path, data) - response = Net::HTTP.post(uri(path), data.to_json, headers) + response = request_with_retry do + Net::HTTP.post(uri(path), data.to_json, headers) + end return response unless response.is_a?(Net::HTTPClientError) @logger.warn "server returned #{response.code} with body: #{response.body}" @@ -47,7 +49,9 @@ def post(path, data) # @param path [String] path relatived to `api`` endpoint. # @return [Net::HTTPResponse, nil] Net::HTTPResponse if it is not an Net::HTTPClientError def get(path) - response = Net::HTTP.get(uri(path), headers) + response = request_with_retry do + Net::HTTP.get(uri(path), headers) + end return response unless response.is_a?(Net::HTTPClientError) @logger.warn "server returned #{response.code} with body: #{response.body}" @@ -57,7 +61,9 @@ def get(path) # @param path [String] path relatived to `api`` endpoint. # @param data [#to_json] data to send in request def put(path, data) - response = Net::HTTP.put(uri(path), data.to_json, headers) + response = request_with_retry do + Net::HTTP.put(uri(path), data.to_json, headers) + end return unless response.is_a?(Net::HTTPClientError) @logger.warn "server returned #{response.code} with body: #{response.body}" @@ -68,8 +74,10 @@ def put(path, data) # @param data [#to_json] data to send in request def patch(path, data) url = uri(path) - http = Net::HTTP.start(url.hostname, url.port, use_ssl: url.scheme == "https") - response = http.patch(url, data.to_json, headers) + response = request_with_retry do + http = Net::HTTP.start(url.hostname, url.port, use_ssl: url.scheme == "https") + http.patch(url, data.to_json, headers) + end return response unless response.is_a?(Net::HTTPClientError) @logger.warn "server returned #{response.code} with body: #{response.body}" @@ -91,6 +99,27 @@ def headers def auth_token File.read("/run/agama/token") end + + CONNECT_ATTEMPTS = 10 + + # Performs a request and retries if it fails. + # + # During initialization, it might happen that Agama's web server is not available. + # This method retries the block if the connection is not possible. + # + # @return [Object] value returned by the block + def request_with_retry(&block) + attempt = 1 + begin + block.call + rescue Errno::ECONNREFUSED => error + @logger.warn "Failed to contact Agama's server (attempt #{attempt} of #{CONNECT_ATTEMPTS})." + raise if attempt == CONNECT_ATTEMPTS + sleep 1 + attempt += 1 + retry + end + end end end end From 739ac34813c8cda1595729321d4adb77089c511a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Thu, 29 Jan 2026 09:59:48 +0000 Subject: [PATCH 3/4] Update changes files --- rust/package/agama.changes | 6 ++++++ service/package/rubygem-agama-yast.changes | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/rust/package/agama.changes b/rust/package/agama.changes index 1e2c096560..88dc2d718b 100644 --- a/rust/package/agama.changes +++ b/rust/package/agama.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 29 09:56:05 UTC 2026 - Imobach Gonzalez Sosa + +- Do not wait for the storage service when setting the configuration + (gh#agama-project/agama#3096, related to bsc#1257067). + ------------------------------------------------------------------- Thu Jan 29 07:04:09 UTC 2026 - Imobach Gonzalez Sosa diff --git a/service/package/rubygem-agama-yast.changes b/service/package/rubygem-agama-yast.changes index a5775e9977..7fafe50da1 100644 --- a/service/package/rubygem-agama-yast.changes +++ b/service/package/rubygem-agama-yast.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 29 09:55:38 UTC 2026 - Imobach Gonzalez Sosa + +- Retry requests to the web server if the connection failed + (gh#agama-project/agama#3096, related to bsc#1257067). + ------------------------------------------------------------------- Wed Jan 28 09:51:16 UTC 2026 - José Iván López González From 9eb056ec1c7d25dbdcc34ca63cb28c8b8b46ee90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imobach=20Gonz=C3=A1lez=20Sosa?= Date: Thu, 29 Jan 2026 10:06:35 +0000 Subject: [PATCH 4/4] Make RuboCop happy --- service/lib/agama/http/clients/base.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/service/lib/agama/http/clients/base.rb b/service/lib/agama/http/clients/base.rb index afe27cb842..1532867799 100644 --- a/service/lib/agama/http/clients/base.rb +++ b/service/lib/agama/http/clients/base.rb @@ -112,9 +112,11 @@ def request_with_retry(&block) attempt = 1 begin block.call - rescue Errno::ECONNREFUSED => error - @logger.warn "Failed to contact Agama's server (attempt #{attempt} of #{CONNECT_ATTEMPTS})." + rescue Errno::ECONNREFUSED => e + @logger.warn "Failed to contact Agama's server with error #{e} " \ + "(attempt #{attempt} of #{CONNECT_ATTEMPTS})." raise if attempt == CONNECT_ATTEMPTS + sleep 1 attempt += 1 retry