8000 Python plugin ignores read callback return value · Issue #2330 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Python plugin ignores read callback return value #2330
Closed
@danielkza

Description

@danielkza
  • Version of collectd:

5.7

  • Operating system / distribution:

Ubuntu 16.04

Expected behavior

Explicitly returning a non-zero integer value from a Python read callback should indicate failure, as it would with a C callback.

My use case is a bit peculiar. I'm attempting to monitor Apache Spark. At any given time, there may be zero or more driver programs running in a worker node in different ports, but I do not have an easy way to acquire that list of ports.

Hence, I try all ports in a predefined list. Hence, read callback can fail most of the time if a driver is not running in a given port. I want to be able to signal failure, such that the interval doubling kicks in, without necessarily printing a stack trace.

Actual behavior

Failure is only signaled if an exception is raised.

Steps to reproduce

Run the following plugin, and observe how the callback interval never raises, as it would be expected from failures.

import collectd

def read_fail():
    return 1

collectd.register_read(read_fail)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0