Coder Social home page Coder Social logo

flatpak-indexer's People

Contributors

kalev avatar owtaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kalev

flatpak-indexer's Issues

Fails to reconnect if broker cancels consumer

In flatpak_indexer/datasource/fedora/bodhi_change_monitor.py, we want to make sure that the updates thread either keeps running or sets an error so that the main process exits. But in:

        # Then we use a timeout of None (never), until the channel is closed
        for method, properties, body_json in channel.consume(queue_name,
                                                             inactivity_timeout=None):
            self._update_from_message(body_json)

This potentially doesn't happen. "The active generator iterator terminates when the consumer is cancelled by client via BlockingChannel.cancel() or by broker" - we never cancel the consumer, but the broker might - for inactivity, just because, etc.

This seems to possibly have happened for the Fedora indexer:

https://pagure.io/fedora-infrastructure/issue/10415

So we should add logic to reconnect in this case. (If we get a new queue on reconnection, we'll need to requery from scratch - so there will need to be some logic changes in the way that updater.py and bodhi_change_monitor.py interact.)

Dynamically download release information from Bodhi

fedora/release_info.py is a liability, because when things change - e.g., a new Flatpaks release is added in Fedora - the indexer breaks in a hard-to-notice fashion.

We can get the same information directly from Bodhi using the https://bodhi.fedoraproject.org/releases/?exclude_archived=1

Endpoint. Basic idea is:

  • Add bodhi_query.py: refresh_updates()
  • Have that cache a JSON-object in redis like:
[
{
   "name": "F34F",
   "content_type": "flatpak",
   "branch": "f34"
}
]
  • Call refresh_* updates() once per update cycle, then load and use it where we currently use release_info.py. (Probably pass the loaded result as a parameter to bodhi_update.py:_query_updates() to reduce redis round-trips.)

Add cleanups for unused deltas

We should clean up deltas that aren't in use any more.

It probably is necessary to have some sort of grace period so that clients using an old downloaded version of the index don't get a 404. But how to determine when a tardiff result or manifest is "recently unused"

A) update the mtime on reuse?
B) keep some sort of "tardiff:expiring" key in redis
C) ?

We actually have the same issue with icons - we clean them up without any sort of grace period.

Put an overall time-limit on index generation

In a test Fedora instance:

  • Delta generation was failing (timing out) for some tardiffs repeatedly, probably because of stuck downloads
  • After a day the tardiff:: entries timed out
  • The tardiff containers then crashed because of the missing spec entries

There's multiple things to fix here, but in general, I think if tardiffs haven't been processed after a couple of hours, the indexer should consider that they won't be, and mark them temporarily/permanently failed and move on to generating the index.

Transient resolving error for rabbitmq.fedoraproject.org leaves indexer stuck

If resolving rabbitmq.fedoraproject.org fails, then socket.gaierror is thrown. This leaves fedora-monitor in a stuck state because that's not caught by:

except (pika.exceptions.AMQPConnectionError, ssl.SSLError) as e:

and then the exception is rethrown when the main thread tries to retrieve changes from the monitor. Adding socket.gaierror there is likely the right thing to do, though perhaps we also need to think about the handling of exceptions during the update process - perhaps the

            try:
                indexer.index(registry_data)
            except Exception:
                logger.exception("Failed to create index")
                continue

in cli/daemon.py is wrong and we should let the app exit, so that openshift will restart it in a clean state?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.