Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions rust/agama-manager/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jan 29 09:56:05 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- 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 <igonzalezsosa@suse.com>

Expand Down
41 changes: 36 additions & 5 deletions service/lib/agama/http/clients/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}"
Expand All @@ -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}"
Expand All @@ -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}"
Expand All @@ -91,6 +99,29 @@ 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 => 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
end
end
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jan 29 09:55:38 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- 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 <jlopez@suse.com>

Expand Down
Loading