ariatosca-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ran Ziv (JIRA)" <>
Subject [jira] [Created] (ARIA-265) Database locked errors when using multi-threaded plugins
Date Sun, 28 May 2017 13:29:04 GMT
Ran Ziv created ARIA-265:

             Summary: Database locked errors when using multi-threaded plugins 
                 Key: ARIA-265
             Project: AriaTosca
          Issue Type: Bug
            Reporter: Ran Ziv
            Priority: Minor

When using multi-threaded plugins, sometimes a {{Database is locked}} error gets raised.

The reason for this is that each thread automatically receives a separate session from SQLAlchemy
for communication with the database. This session must be closed properly before the thread
terminates, or else other attempts of interacting with the database could hang (and lead to
the error mentioned above).

One way to avoid this is for plugin authors to ensure they shut the session down properly
for each thread the plugin creates.

Another possible solution would be to save all sessions created on the operation's {{ctx}}
object, and clean them up automatically afterwards.

This message was sent by Atlassian JIRA

View raw message