Branch: refs/heads/2.6 Home: https://github.com/openSUSE/open-build-service Commit: f221149afe40b21cd88975b6d27cd0660cb83499 https://github.com/openSUSE/open-build-service/commit/f221149afe40b21cd88975... Author: Daniel Gollub firstname.lastname@example.org 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