laravel-scout-tntsearch-driver icon indicating copy to clipboard operation
laravel-scout-tntsearch-driver copied to clipboard

General error: 5 database is locked

Open elephantux opened this issue 7 years ago • 4 comments

General error: 5 database is locked in /var/www/mysteria.city/vendor/teamtnt/tntsearch/src/TNTSearch.php:411

Queue works with database:

'database' => [
            'driver' => 'database',
            'table' => 'jobs',
            'queue' => 'default',
            'retry_after' => 90,
        ],

On server work Supervisor with this settings:

[program:mcity-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/mysteria.city/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=8
redirect_stderr=true
stdout_logfile= /var/www/mysteria.city/worker.log

Scout has default settings. Console command php artisan tntsearch:import App\\Post work fine without any errors.

Any ideas?

elephantux avatar Aug 23 '18 10:08 elephantux

Yeah, multiple processes are accessing the index at once. You should somehow restrict it to one worker for the indexing

nticaric avatar Aug 23 '18 10:08 nticaric

Ho to set second separate supervisor worker for indexing only? And restrict indexing in main worker? Any example may be?

elephantux avatar Aug 23 '18 10:08 elephantux

@elephantux https://github.com/teamtnt/laravel-scout-tntsearch-driver/issues/61#issuecomment-401409268

thoresuenert avatar Sep 12 '18 07:09 thoresuenert

Any updates to this issue?

PhpUnit tests get locked up on any class using use Searchable with SCOUT_DRIVER=tntsearch in scout.php set

Any workarounds haven't proved fruitful so far

vbasky avatar Nov 04 '19 05:11 vbasky