[ckan-changes] [ckan/ckan] 332339: [#3332] Properly close database connections in bac...

GitHub noreply at github.com
Tue Nov 29 12:45:41 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/ckan/ckan
  Commit: 33233941953523261075ace93ff7cbde6a928e49
      https://github.com/ckan/ckan/commit/33233941953523261075ace93ff7cbde6a928e49
  Author: Florian Brucker <florian.brucker at mb.karlsruhe.de>
  Date:   2016-11-28 (Mon, 28 Nov 2016)

  Changed paths:
    M ckan/config/environment.py
    M ckan/lib/jobs.py

  Log Message:
  -----------
  [#3332] Properly close database connections in background workers

RQ background workers exit via `os._exit`, which (by design) omits all
of Python's usual clean up routines. As a result, the SQLAlchemy session
and its associated database connections have to be cleaned up manually.
This hadn't been done before, leading to sporadic exceptions due to SSL
connections being unexpectedly closed.

This commit fixes that situation by properly closing each worker's
SQLAlchemy session and its associated database connections.


  Commit: 911c2e48abc018cf7ab55ceb9cb62f9e96f46859
      https://github.com/ckan/ckan/commit/911c2e48abc018cf7ab55ceb9cb62f9e96f46859
  Author: Adrià Mercader <amercadero at gmail.com>
  Date:   2016-11-29 (Tue, 29 Nov 2016)

  Changed paths:
    M ckan/config/environment.py
    M ckan/lib/jobs.py

  Log Message:
  -----------
  Merge pull request #3337 from torfsen/3332-close-worker-db-connection

[#3332] Properly close database connections in background workers


Compare: https://github.com/ckan/ckan/compare/d8dd8a8971cd...911c2e48abc0


More information about the ckan-changes mailing list