Code Monkey home page Code Monkey logo

cotyledon's Introduction

Cotyledon

Latest Version Downloads https://travis-ci.org/sileht/cotyledon.png?branch=master

Cotyledon provides a framework for defining long-running services.

It provides handling of Unix signals, spawning of workers, supervision of children processes, daemon reloading, sd-notify, rate limiting for worker spawning, and more.

Why Cotyledon

This library is mainly used in OpenStack Telemetry projects, in replacement of oslo.service. However, as oslo.service depends on eventlet, a different library was needed for project that do not need it. When an application do not monkeypatch the Python standard library anymore, greenlets do not in timely fashion. That made other libraries such as Tooz or oslo.messaging to fail with e.g. their heartbeat systems. Also, processes would not exist as expected due to greenpipes never being processed.

oslo.service is actually written on top of eventlet to provide two main features:

  • periodic tasks
  • workers processes management

The first feature was replaced by another library called futurist and the second feature is superseded by Cotyledon.

Unlike oslo.service, Cotyledon have:

  • The same code path when workers=1 and workers>=2
  • Reload API (on SIGHUP) hooks work in case of you don't want to restarting children
  • A separated API for children process termination and for master process termination
  • Seatbelt to ensure only one service workers manager run at a time.
  • Is signal concurrency safe.
  • Support non posix platform, because it's built on top of multiprocessing module instead of os.fork
  • Provide functional testing

And doesn't:

  • facilitate the creation of wsgi application (sockets sharing between parent and children process). Because too many wsgi webserver already exists.

oslo.service being impossible to fix and bringing an heavy dependency on eventlet, Cotyledon appeared.

cotyledon's People

Contributors

sileht avatar jd avatar kajinamit avatar toabctl avatar edwardbetts avatar geoffkoh avatar xavfernandez avatar ggardet avatar

Stargazers

Taha Naqvi avatar Pavlin Nikolov avatar  avatar HyunSoo avatar Timothy Makobu avatar  avatar Robin Giesen avatar Alison O. Gaby avatar Mrinal Sinha avatar Sid Mitra avatar Caspian Ireland avatar Mohammed Ashour avatar  avatar chris avatar  avatar Alexandre avatar  avatar xiaoruiguo avatar f avatar frankfanslc avatar cadl avatar Ribhu Lahiri avatar Arthur Chiu avatar  avatar  avatar Roman Glushko avatar Visesh Rajendraprasad avatar  avatar Apostolos V. avatar Jonathan Kolyer avatar Shuchu Han avatar  avatar Guoqiang Ding avatar M-Kepler avatar Alexandre Yukio Harano avatar Eunwoo Cho avatar  avatar messense avatar Alex Tsilingiris avatar Bartosz Żurkowski avatar  avatar Lake Chan avatar  avatar Jason avatar Vincent yu avatar Stefan Hagen avatar Edgaras L avatar Dan Hugo avatar Hervé Beraud avatar Dmytro Vasylyshyn avatar Brian Bae avatar Guy Eshet avatar  avatar fjack avatar Sergei avatar Glen Ferguson avatar thrbowl avatar  avatar Max avatar thewind avatar Yi Wei avatar Nguyễn Bá Thành avatar Andrey Oleynik avatar Jocelyn Boullier avatar Tianyuan Sun avatar Pablo Cabezas avatar Morteza NourelahiAlamdari avatar gogo avatar  avatar Marc Tudurí avatar Fedele Mantuano avatar Nikolaus Schlemm avatar Yujun Zhang avatar  Sanket Sudake avatar xb avatar Philippe Pepiot avatar Cédric Bonhomme avatar  avatar Olakunle Olaniyi avatar Derek F avatar Andrey Shtykovskiy avatar siraset jirapatchandej avatar Yaroslav avatar dr_gogeta86 avatar iliiilliilliii avatar Kien Nguyen-Tuan avatar tom.wen avatar Six avatar Pzhang avatar

Watchers

 avatar  avatar siraset jirapatchandej avatar James Cloos avatar

cotyledon's Issues

PicklingError when using cotyledon on win64

Unsure how to proceed/mitigate this one. I normally run on Ubuntu or macOS. First time we're trying on win64 (developer workstation).

It seems to originate with a call from cotyledon, but I don't see any reference to identity in the cotyledon source, nor in my own project. Thoughts welcomed!

File "C:\...path-to-venv...\lib\site-packages\cotyledon\_utils.py", line 69, in spawn_process
  p.start()
File "C:\Python27\Lib\multiprocessing\process.py", line 130, in start
  self._popen = Popen(self)
File "C:\Python27\Lib\multiprocessing\forking.py", line 277, in __init__
  dump(process_obj, to_child, HIGHEST_PROTOCOL)
File "C:\Python27\Lib\multiprocessing\forking.py", line 199, in dump
  ForkingPickler(file, protocol).dump(obj)
File "C:\Python27\Lib\pickle.py", line 224, in dump
  self.save(obj)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 568, in save_tuple
  save(element)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 554, in save_tuple
  save(element)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 331, in save
  self.save_reduce(obj=obj, *rv)
File "C:\Python27\Lib\pickle.py", line 425, in save_reduce
  save(state)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 687, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 655, in save_dict
  self._batch_setitems(obj.iteritems())
File "C:\Python27\Lib\pickle.py", line 692, in _batch_setitems
  save(v)
File "C:\Python27\Lib\pickle.py", line 286, in save
  f(self, obj) # Call unbound method with explicit self
File "C:\Python27\Lib\pickle.py", line 754, in save_global
  (obj, module, name))

PicklingError: Can't pickle <function identity at 0x03F9B230>: it's not found as argparse.identity

Sharing objects between processes

Is it safe to pass complex objects into cotyledon services, e.g. a DB connection?

self.add(probe.MyServiceA, workers=1, args=(objA, objB, dbConn))
self.add(probe.MyServiceB, workers=1, args=(objA, objB, dbConn))

What consequences (if any) should I expect?

Excess logging in ceilometer-agent-notification in Newton with cotyledon-1.6.6

ceilometer-agent.notification.log goes on increasing like 20Gb/day
Below is part of logfile
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 489, in listen_for_notifications
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils conn = self._get_connection(rpc_common.PURPOSE_LISTEN)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py", line 371, in _get_connection
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils purpose=purpose)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/oslo_messaging/_drivers/common.py", line 394, in init
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils self.connection = connection_pool.create(purpose)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/oslo_messaging/_drivers/pool.py", line 144, in create
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils return self.connection_cls(self.conf, self.url, purpose)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/oslo_messaging/_drivers/impl_rabbit.py", line 608, in init
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils self.ensure_connection()
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/oslo_messaging/_drivers/impl_rabbit.py", line 707, in ensure_connection
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils self.ensure(method=lambda: self.connection.connection)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/oslo_messaging/_drivers/impl_rabbit.py", line 814, in ensure
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils ret, channel = autoretry_method()
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/kombu/connection.py", line 436, in _ensured
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils return fun(*args, **kwargs)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/kombu/connection.py", line 507, in call
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils self.revive(create_channel())
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/kombu/connection.py", line 242, in channel
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils chan = self.transport.create_channel(self.connection)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/kombu/connection.py", line 742, in connection
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils self._connection = self._establish_connection()
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/kombu/connection.py", line 697, in _establish_connection
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils conn = self.transport.establish_connection()
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/kombu/transport/pyamqp.py", line 116, in establish_connection
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils conn = self.Connection(**opts)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/amqp/connection.py", line 180, in init
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils (10, 30), # tune
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/amqp/abstract_channel.py", line 67, in wait
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils self.channel_id, allowed_methods, timeout)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/amqp/connection.py", line 274, in _wait_method
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils wait()
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/amqp/abstract_channel.py", line 69, in wait
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils return self.dispatch_method(method_sig, args, content)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/amqp/abstract_channel.py", line 87, in dispatch_method
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils return amqp_method(self, args)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils File "/openstack/venvs/ceilometer-14.0.5/lib/python2.7/site-packages/amqp/connection.py", line 530, in _close
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils (class_id, method_id), ConnectionError)
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
2017-02-01 05:30:00.019 29021 ERROR cotyledon._utils
2017-02-01 05:30:00.028 30648 INFO cotyledon._service_manager [-] Child 29021 exited with status 2
2017-02-01 05:30:00.028 30648 INFO cotyledon._service_manager [-] Forking too fast, sleeping

reconfigure workers based on a callback evaluated at intervals

I want to start n workers and scale (reconfigure) them up/down based on number of task from a remote queue (access via REST api). How can I do this?

One suggestion is implementing on_interal_evalcallback that runs a function at certain interval and can reconfigure the manager.

End ServiceManager when a specific Service stops

Hello and thanks for this project.

I'd be interested in having a special flag to tell that a Service should not be restarted and should instead lead to the exit of the ServiceManager.

Would there be interest to include such feature to cotyledon ?
(To know if it is worth it to spend time on a PR or it has no chance of being merged :) )

Cannot SIGINT a service manager when ran through make

We're running a ServiceManager through a make command similar to this:

run_server:
    python /path/to/server/run.py

Our run.py basically does this:

p = cotyledon.ServiceManager()
p.add(...)
p.run()

However, calling os.setsid as done by the service manager(https://github.com/sileht/cotyledon/blob/master/cotyledon/_service_manager.py#L126-L130) renders pressing ctrl-c ineffective. Sending a SIGINT signal using kill to the make process doesn't stop the server. Sending SIGINT to the service manager process does interrupt it.

I'm not too familiar with how make handles signals, but according to this coreutils issue, it seems that:

What seems to be happening is that make doesn't create a process group,
therefore assumes that when it gets a SIGINT, its children have already
gotten it too, and it just waits for them to die. A child that puts itself
into a new process group screws this up (as would kill -2 pidof make).

Creating a new session for cotyledon's service manager seems to break make's expectation of SIGINT propagating to its children.

Removing the call to os.setsid allows me to cancel the server launched by make using a SIGINT signal.

What do you think about this? Is creating a new session really useful? It seems not, as it gets ignored when unavaible (e.g.: when running on Windows).

Race condition with SIGTERM during startup

Maybe a somewhat contrived scenario but:

def sigterm_during_init():
    import threading
    def kill():
        os.kill(os.getpid(), signal.SIGTERM)

    # Kill in 0.01 sec
    threading.Timer(0.01, kill).start()
    p = cotyledon.ServiceManager()
    p.add(LigthService, 10)
    p.run()

can end up with the manager stuck (i.e. with at least a child, but not respawning anything and not responding to SIGTERM):

$ python cotyledon/tests/examples.py sigterm_during_init
DEBUG:cotyledon._service:Run service light(0) [3286]
DEBUG:cotyledon._service:Run service light(2) [3290]
DEBUG:cotyledon._service:Run service light(1) [3287]
DEBUG:cotyledon._service:Run service light(4) [3295]
INFO:cotyledon._service_manager:Caught SIGTERM signal, graceful exiting of master process
DEBUG:cotyledon._service:Run service light(3) [3292]
DEBUG:cotyledon._service:Run service light(5) [3298]
DEBUG:cotyledon._service:Run service light(6) [3303]
DEBUG:cotyledon._service:Run service light(7) [3305]
DEBUG:cotyledon._service_manager:Killing services with signal SIGTERM
INFO:cotyledon._service:Caught SIGTERM signal, graceful exiting of service light(3) [3292]
INFO:cotyledon._service:Caught SIGTERM signal, graceful exiting of service light(1) [3287]
INFO:cotyledon._service:Caught SIGTERM signal, graceful exiting of service light(2) [3290]
INFO:cotyledon._service:Caught SIGTERM signal, graceful exiting of service light(5) [3298]
INFO:cotyledon._service:Caught SIGTERM signal, graceful exiting of service light(0) [3286]
DEBUG:cotyledon._service_manager:Waiting services to terminate
INFO:cotyledon._service:Caught SIGTERM signal, graceful exiting of service light(6) [3303]
INFO:cotyledon._service:Caught SIGTERM signal, graceful exiting of service light(4) [3295]
DEBUG:cotyledon._service:Run service light(8) [3308]
DEBUG:cotyledon._service:Run service light(9) [3311]
INFO:cotyledon._service:Caught SIGTERM signal, graceful exiting of service light(7) [3305]

^CINFO:cotyledon._service_manager:Caught SIGINT signal, instantaneous exiting

AssertionError: can only join a child process

When starting gnocchi-metricd using pifpaf. I think it's a bug in Cotyledon, but I'm not sure :(

DEBUG: pifpaf.drivers: executing: ['gnocchi-metricd', '--config-file=/var/folders/7k/pwdhb_mj2cv4zyr0kyrlzjx40000gq/T/tmp_heguw/gnocchi.conf']
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 CRITICAL gnocchi [-] IOError: [Errno 22] Invalid argument
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi Traceback (most recent call last):
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi   File "/usr/local/bin/gnocchi-metricd", line 10, in <module>
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi     sys.exit(metricd())
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi   File "/Users/jd/Source/gnocchi/gnocchi/cli.py", line 332, in metricd
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi     MetricdServiceManager(conf).run()
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi   File "/usr/local/lib/python2.7/site-packages/cotyledon/__init__.py", line 273, in run
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi     pid = self._start_service(conf, worker_id)
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi   File "/usr/local/lib/python2.7/site-packages/cotyledon/__init__.py", line 426, in _start_service
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi     time.sleep(1000000000)
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi IOError: [Errno 22] Invalid argument
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.633 46241 ERROR gnocchi
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: Error in atexit._run_exitfuncs:
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: Traceback (most recent call last):
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:   File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:     func(*targs, **kargs)
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:   File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py", line 325, in _exit_function
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:     p.join()
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:   File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 143, in join
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 CRITICAL gnocchi [-] IOError: [Errno 22] Invalid argument
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi Traceback (most recent call last):
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi   File "/usr/local/bin/gnocchi-metricd", line 10, in <module>
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi     sys.exit(metricd())
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi   File "/Users/jd/Source/gnocchi/gnocchi/cli.py", line 332, in metricd
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi     MetricdServiceManager(conf).run()
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi   File "/usr/local/lib/python2.7/site-packages/cotyledon/__init__.py", line 273, in run
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi     pid = self._start_service(conf, worker_id)
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi   File "/usr/local/lib/python2.7/site-packages/cotyledon/__init__.py", line 426, in _start_service
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi     time.sleep(1000000000)
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi IOError: [Errno 22] Invalid argument
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.630 46239 ERROR gnocchi
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:     assert self._parent_pid == os.getpid(), 'can only join a child process'
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: AssertionError: can only join a child process
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: Error in sys.exitfunc:
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: Error in atexit._run_exitfuncs:
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: Traceback (most recent call last):
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:   File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:     func(*targs, **kargs)
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:   File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py", line 325, in _exit_function
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:     p.join()
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output:   File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 143, in join
DEBUG: pifpaf.drivers: gnocchi-metricd[46224] output: 2016-08-02 18:11:16.683 46241 CRITICAL gnocchi [-] AssertionError: can only join a child process

setuptools warnings

 * QA Notice: setuptools warnings detected:
 * 
 * 	Usage of dash-separated 'author-email' will not be supported in future versions. Please use the underscore name 'author_email' instead
 * 	Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
 * 	Usage of dash-separated 'home-page' will not be supported in future versions. Please use the underscore name 'home_page' instead```

os.setsid() does not exist on Windows

Taken from: https://bugs.launchpad.net/ceilometer/+bug/1625602

2016-09-20 14:49:43.069 528 CRITICAL ceilometer [-] AttributeError: 'module' object has no attribute 'setsid'
2016-09-20 14:49:43.069 528 ERROR ceilometer Traceback (most recent call last):
2016-09-20 14:49:43.069 528 ERROR ceilometer   File "C:\Program Files\Cloudbase Solutions\OpenStack\Nova\Python27\Scripts\ceilometer-polling-script.py", line 9, in <module>
2016-09-20 14:49:43.069 528 ERROR ceilometer     load_entry_point('ceilometer==7.0.0.0rc2.dev2', 'console_scripts', 'ceilometer-polling')()
2016-09-20 14:49:43.069 528 ERROR ceilometer   File "C:\Program Files\Cloudbase Solutions\OpenStack\Nova\Python27\lib\site-packages\ceilometer\cmd\polling.py", line 89, in main
2016-09-20 14:49:43.069 528 ERROR ceilometer     sm = cotyledon.ServiceManager()
2016-09-20 14:49:43.069 528 ERROR ceilometer   File "C:\Program Files\Cloudbase Solutions\OpenStack\Nova\Python27\lib\site-packages\cotyledon\__init__.py", line 214, in __init__
2016-09-20 14:49:43.069 528 ERROR ceilometer     os.setsid()
2016-09-20 14:49:43.069 528 ERROR ceilometer AttributeError: 'module' object has no attribute 'setsid'
2016-09-20 14:49:43.069 528 ERROR ceilometer

Using pdb

Is it possible to use pdb for debugging when using cotyledon? Whenever I set trace, I get the following error:

  File "/usr/local/lib/python3.7/bdb.py", line 88, in trace_dispatch
    return self.dispatch_line(frame)
  File "/usr/local/lib/python3.7/bdb.py", line 113, in dispatch_line
    if self.quitting: raise BdbQuit
bdb.BdbQuit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.