• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cloudmarker / cloudmarker / 901 / 3
84%
master: 84%

Build:
DEFAULT BRANCH: master
Ran 12 Jun 2019 07:55AM UTC
Files 43
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jun 2019 07:44AM UTC coverage: 90.225% (-0.3%) from 90.485%
901.3

push

travis-ci-com

susam
Instantiate plugins in worker processes

Prior to this change, the plugin classes are instantiated in the main
process running `manager.py` and the instantiated plugins are passed to
the respective worker processes implemented in `workers.py` via
`multiprocessing.Queue` objects.

Instantiating a plugin in the main process in `manager.py` and then
passing it to a worker process via a queue is problematic. If a plugin
is not fork-safe, it may not function correctly when used inside a
worker process. One such problem was found with the `MongoDBStore`
plugin which is not fork-safe because it in turn instantiates
`MongoClient` which is not fork-safe. The following warning is
encountered while using `MongoDBStore`:

    UserWarning: MongoClient opened before fork. Create MongoClient only
    after forking. See PyMongo's documentation for details:
    http://api.mongodb.org/python/current/faq.html#is-pymongo-fork-safe
    "MongoClient opened before fork. Create MongoClient only "

There is another possible problem too. If a plugin is not picklable
(serialiazble), then attempting to pass an instantiated plugin over a
`multiprocessing.Queue` object would lead to `PickleError`.

To prevent these issues, this change implements a new strategy for
instantiating the plugins. The main process running `manager.py` passes
the plugin config dictionaries to the worker processes over
`multiprocessing.Queue` objects. The worker processes instantiate the
plugins from the plugin config dictionaries. This ensures that we pass
only a serializable object (i.e., a dictionary, not an instantiated
plugin) over the queue. It also ensures that a plugin is instantiated in
the same process where it is used, i.e., within a worker process.

491 of 546 branches covered (89.93%)

Branch coverage included in aggregate %.

2075 of 2298 relevant lines covered (90.3%)

0.9 hits per line

Source Files on job 901.3
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 736
  • Travis Job 901.3
  • 9b8c0cac on github
  • Prev Job for on master (#898.2)
  • Next Job for on master (#904.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc