Branch: refs/heads/master Home: https://github.com/openSUSE/open-build-service Commit: 83b985ad4fc2a58bc048655c7c141c03117946a7 https://github.com/openSUSE/open-build-service/commit/83b985ad4fc2a58bc04865... Author: Daniel Gollub email@example.com Date: 2015-09-08 (Tue, 08 Sep 2015)
Changed paths: M src/api/config/clock.rb
Log Message: ----------- [api] fix db conn leak caused by reindex run
The delay job with delayed_job_active_record as queue_adapter creates for each FullTextSearch.new.delay.index_and_start a delayed_job entry in the MySQL/MariaDB.
This delayed job gets created in a periodic clockwork event. The sphinx-reindex clockwork event is the only event in clock.rb which runs delayed _and_ inside a clockword thread.
Since the delayed job gets created in inside the clockworkd thread the delayed job ActiveRecord code establishes a new MySQL/MariaDB client connection (regardless if socket or TCP is configured) without using existing database connections.
This repeast until the number of connection in the configured database pool is exceeded.
Which causes fetch-notification and other clock.rb events using ActiveRecord::Base.connection_pool to fail once the connection pool is exhausted.
Related to issue#988