Skip to content

Conversation

@lslezak
Copy link
Contributor

@lslezak lslezak commented May 16, 2025

Problem

  • Agama installation jumps to congratulation page without any middle page shown
  • https://bugzilla.suse.com/show_bug.cgi?id=1241208
  • This is a race condition, it depends on exact timing. Usually the data is read before the package installation starts, but in some cases not.

Details

  • The problem is that the software service is blocked by the running libzypp installation and does not respond to the requests.
  • The /api/software/config and /api/software/products results are returned after the whole installation is finished
    agama-blocked-services

Solution

  • Store the software data before starting the installation, during installation return the cached data.

Testing

  • Tested manually

@coveralls
Copy link

coveralls commented May 16, 2025

Coverage Status

coverage: 62.922% (-0.09%) from 63.008%
when pulling a0090ce on cached_software
into 29bbf0f on master.

@lslezak lslezak marked this pull request as ready for review May 20, 2025 14:58
@lslezak lslezak merged commit 7740579 into master May 20, 2025
10 of 11 checks passed
@lslezak lslezak deleted the cached_software branch May 20, 2025 16:38
imobachgs added a commit that referenced this pull request May 22, 2025
## Problem

It is a known problem that the software service can get blocked at
several stages and it has an impact in the UI and the CLI. We mitigated
that problem in #2364 but there are still some cases that are not
handled properly.

For instance, during software probing, Agama is not able to return the
list of issues. we could argue whether the list of issues is still
valid, but that's a different topic. At least, Agama should return
something.

## Solution

This PR implements a new `IssuesService` which handles and caches the
issues for any service. At this point, it is only used by the software
service, but the idea is to use it from all the services.

Apart from caching the issues, it offers a centralized way of keeping
track of the issues, listening for changes in single place (instead of
building and processing an stream of events for each of the services).
For instance, the iSCSI API was not emitting the `IssuesChanged` events
because we forgot to add the call to `issues_stream`. Now, it is done
automatically.

The service uses [Tokio
channels](https://tokio.rs/tokio/tutorial/channels) and message passing
to [share the state](https://tokio.rs/tokio/tutorial/shared-state).

> [!NOTE]
> The problem is not fully solved because the "can_install" function
still relies on D-Bus, which still blocks.

## Testing

- Tested manually

## Tasks

- [x] Implement an IssuesService.
- [x] Emit the events from the service itself.
- [x] Adopt `IssuesService` in other services.

## Follow ups

Most probably, we should implement a mechanism like this for progress
tracking too, although given to the amount of progress signals it is
rarely a problem.
imobachgs added a commit that referenced this pull request May 23, 2025
## Problem

Follow-up of #2379.

It is a known problem that the software service can get blocked at
several stages and it has an impact in the UI and the CLI. We handled
part of that problem in #2364 and #2379, but there are still some cases
that are not handled properly.

For instance, during software probing, Agama is not able to return the
current progress.

## Solution

This PR implements a new `ProgressService` which handles and caches the
progress for any service.

Apart from caching the progress, it offers a centralized way of keeping
track of the progress, listening for changes in single place (instead of
building and processing an stream of events for each of the services).

The service uses [Tokio
channels](https://tokio.rs/tokio/tutorial/channels) and message passing
to [share the state](https://tokio.rs/tokio/tutorial/shared-state).

As part of this change, I have decided to introduce a new
`ProgressChanged` signal, which carries the information we need, instead
of relying on the generic `PropertiesChanged`.

## Testing

- Tested manually
- An ISO is [temporarily
available](https://download.opensuse.org/repositories/systemsmanagement:/Agama:/branches:/non-blocking-progress/images/iso/).
@imobachgs imobachgs mentioned this pull request May 26, 2025
imobachgs added a commit that referenced this pull request May 26, 2025
imobachgs added a commit that referenced this pull request Jul 2, 2025
## Problem

Some time ago we, we introduced [a
cache](#2364) to store the
software data and avoid blocking the UI. The problem is that the list of
products is cached only when a client asks for it. So in the case of an
unattended installation, it might happen that the installation starts
before the web UI asks for the list of products for the first time.

- Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1241208

## Solution

Read the list of products during the web server initialization. It will
be updated only when the locale changes.

## Testing

- *Tested manually*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants