[Toaster] [review-request][PATCH 3/3] bitbake: toastermain: Add a longer default database timeout

Michael Wood michael.g.wood at intel.com
Thu Aug 6 07:28:29 PDT 2015


Should have mentioned that this is a v2 series of

https://lists.yoctoproject.org/pipermail/toaster/2015-July/002428.html
https://lists.yoctoproject.org/pipermail/toaster/2015-July/002429.html
https://lists.yoctoproject.org/pipermail/toaster/2015-July/002430.html

Which is now rebased and with the fixes for review items mentioned by Ed

Michael

On 06/08/15 15:25, Michael Wood wrote:
> When using sqlite we sometimes see Database Locked exceptions when we
> fire off database calls asynchronously from the UI. We need sqlite to
> wait a bit longer for the lock to be released.
> n.b In production setup we hopefully wouldn't be using sqlite.
>
> docs.djangoproject.com/en/1.6/ref/databases/#database-is-locked-errors
>
> Signed-off-by: Michael Wood <michael.g.wood at intel.com>
> ---
>   bitbake/lib/toaster/toastermain/settings.py | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
> index c72a904..b149a5e 100644
> --- a/bitbake/lib/toaster/toastermain/settings.py
> +++ b/bitbake/lib/toaster/toastermain/settings.py
> @@ -49,6 +49,12 @@ DATABASES = {
>       }
>   }
>   
> +# Needed when Using sqlite especially to add a longer timeout for waiting
> +# for the database lock to be  released
> +# https://docs.djangoproject.com/en/1.6/ref/databases/#database-is-locked-errors
> +if 'sqlite' in DATABASES['default']['ENGINE']:
> +    DATABASES['default']['OPTIONS'] = { 'timeout': 20 }
> +
>   # Reinterpret database settings if we have DATABASE_URL environment variable defined
>   
>   if 'DATABASE_URL' in os.environ:



More information about the toaster mailing list