| Summary: | Change the way we handle queued builds | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Toaster | Reporter: | Belen Barros Pena <belen.barros.pena> |
| Component: | toaster | Assignee: | Ed Bartosh <eduard.bartosh> |
| Status: | RESOLVED FIXED | QA Contact: | Libertad <libertad.gonzalez.de.la.cruz> |
| Severity: | normal | ||
| Priority: | Medium | CC: | belen.barros.pena, elliot.smith, jessica.zhang, stanciux.mihail |
| Version: | 2.0 | ||
| Target Milestone: | 2.2 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Belen Barros Pena
2016-01-13 17:53:23 UTC
This was discussed in the Toaster weekly meeting 13th January 2016. Brian suggested that instead of polling the db (our current approach), we look at the queue of build requests when a build completes. To get the first build going, we just run it as soon as it is requested, providing there are no ongoing builds. If there are ongoing builds, we add the new request to the queue and trigger it when the current build completes. Django signals might be a way of listening for build completion. Note that the underlying issue is the one we ran across when upgrading to Django 1.8: we have multiple processes accessing a SQLite database in parallel, contending for locks on the database file. A longer-term goal might be to change how we access the database, so that we have a single point of access when using SQLite, while still allowing multiple points of access for other database. This would require *significant* reworking of the code base, though. Another side issue is that we have separate build requests and build tables. This seems unnecessary, and makes it complicated for us to do things like showing queued requests (as we have to combine records from two database tables). There's no reason we couldn't just get rid of build requests and have Build objects with a "queued" status instead. Again, this might make the above simpler. Using django signals for this is impossible as they work only in one django process. We'll be sending POSIX signal SIGUSR1 to runbuilds and will poll database only when signal received. Implemented in this patchset: https://lists.yoctoproject.org/pipermail/toaster/2016-September/005179.html Please, review The fix has been merged into poky master. |