Skip to content

Commit 736d6f1

Browse files
authored
Merge pull request #375 from kenhys/warn-plugin
1.0: add note about breaking functionality
2 parents 17cb90e + 0959a28 commit 736d6f1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

deployment/plugin-management.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ fluent-gem install fluent-plugin-grep
1414

1515
Ruby does not guarantee the C extension API compatibility between its major versions. If you update Fluentd's Ruby version, you should reinstall the plugins that depend on C extension.
1616

17+
### Do not use unreliable plugins
18+
19+
Any fluentd plugin can unknowingly break fluentd completely (and possibly break other plugins) by requiring some incompatible modules.
20+
21+
There is no way to block this kind of situation. This is because the problem itself is derived from plug-in mechanism, and that's Lightweight Language.
22+
One solution is "Do not use unreliable plugins".
23+
24+
Generally speaking, plug-in mechanism can break core functionality not only Fluentd but also in most other software.
25+
We shouldn't use unreliable plugins in any software.
26+
27+
We recommend to send feedback to plugin owner if you faced such a fault in plugins.
28+
1729
### If Using `td-agent`, Use `/usr/sbin/td-agent-gem`
1830

1931
If you are using `td-agent`, make sure that you use `td-agent-gem` command to install gems for it. Otherwise, you won't be able to find the **installed** plugins.

plugin-development/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ It is recommended to use the new v1 plugin API for writing new plugins.
5151

5252
If you have a problem with any existing plugins or a new feature idea, sending a patch is better. If the plugin author is non-active, try to become its new plugin maintainer first. Forking a plugin and release its alternative version, e.g. `fluent-plugin-xxx-alt` is considered the last option.
5353

54+
### Be careful not breaking Fluentd's core functionality
55+
56+
Any fluentd plugin can unknowingly break fluentd completely (and possibly break other plugins) by requiring some incompatible modules.
57+
58+
One typical example is reloading `yajl/json_gem` from plugin. (`yajl/json_gem` compatibility layer is problematic, not for `yajl` itself)
59+
It breaks a functionality to parse Fluentd's configuration completely.
60+
61+
Fluentd's plug-in mechanism has a merit to extend functionality, but plugin developer must be careful a possibility of breaking it.
62+
5463
## Writing Plugins
5564

5665
To create a plugin as a Ruby script \(to put it in `/etc/fluent/plugin/` directory\), create a `<TYPE>_<NAME>.rb` file in any editor/IDE of your choice.

0 commit comments

Comments
 (0)