-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore individual options for out copy #303
Ignore individual options for out copy #303
Conversation
it will only raise an exception if all outputs fail.
Uses a fault tolerant output chain to only fail if all outputs fail.
result = @array[@offset-1].emit(@tag, es, self) | ||
rescue Exception => e | ||
@errors += 1 | ||
raise e if not @fault_tolerant or @errors == @array.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fluentd code uses !
instead of not
.
Ah, also ||
is popular than or
in fluentd.
rescue Exception => e | ||
@errors += 1 | ||
raise e if not @fault_tolerant or @errors == @array.length | ||
$log.error e.message, :error => e.to_s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add :error_class => e.class.to_s
.
I am considering buffer error handling improvement. |
@repeatedly implemented in #306 |
btw, you mentioned you were working on streaming errors to another plugin, that sounds like a very good idea, will it be based on |
@dterror It is based on new Engine routing. We need more time to apply this change to current version. |
end | ||
@offset += 1 | ||
result = @array[@offset-1].emit(@tag, es, self) | ||
rescue Exception => e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not rescue Exception. Exception is super base class of ruby's error including NoMemoryError, SyntaxError. rescue => e
should be fine.
After review the code, I have one idea. Or specifying plugin id like |
rescue Exception => e | ||
@errors += 1 | ||
raise e if !@fault_tolerant || @errors == @array.length | ||
$log.error e.message, :error => e.to_s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.message and e.to_s are the same, so this is not informative.
$log.error :error_class => e.class.to_s, :error => e.to_s
is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about $log.error :error_class => e.class.to_s, :error => e.message
? e.message
is more semantic than e.to_s
imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine :-)
Making sure to log all exceptions so that information is not lost.
@repeatedly I think that with the implementation of |
What does 'general' mean? |
I mean it won't need a granular control such as |
@dterror I see. But only |
They can ignore For example, for my use case in particular I could use: <match foo.bar.*>
type copy
ignore_individual_errors true
<store>
type s3
#...
</store>
<store>
type elasticsearch
#...
</store>
</match> If its okay for either to fail, but not both. OR <match foo.bar.*>
type copy
<store>
type s3
#...
</store>
<store>
type elasticsearch
buffer_ignore_exceeded_chunk true
#...
</store>
</match> If S3 can't to fail. It's my belief that |
Yeah but other error occurs. Hmm, Fluentd's config parameter can accept any type. I will add array support for other use-cases. |
Although I am not familiar with S3 plugin, |
Oh, current implementation raises |
The proposal of this PR want to ignore the exception which caused by un-important plugin. This is why I propose |
The reason to ignore the exception is (#296)
So, I thought as the ultimate goal of this PR is to create a option not to break the chain. Suppressing to raise errors in each plugin, and raising OutputChainError after all plugins are processed achieves the goal. |
I think no. This behaviour breaks the transaction. Currently, Input plugin assumes |
No, my approach is succeeded (when no plugin fail) or raises an error (when one or some of plugins fails). |
My 'succeeded' means out_copy processes remaining plugins if error occurred. If we select your approach, out_copy should keep failed plugin lists for avoiding log duplication. P.S. |
I see your point @repeatedly. Covering more cases does make sense. I'll change the implementation. <match foo.bar.*>
type copy
<store>
type s3
#...
</store>
<store ignore-failure>
type elasticsearch
#...
</store>
</match> |
looks nice for me. |
Another one idea. This issue will be resolved by error stream. I'm not sure which is the best... |
How long until error stream is out? what will it look like and is there anything I can do help? If that's the 'proper' way to go, I think it's fair to wait. |
That is, provided error stream is outlined and is not going to take too long. I still think |
In my plan, v1 includes error stream and now working to implement v1 features. |
Since it looks |
This addresses #296 by adding a fault-tolerant option to
OutputChain
. With this, it will only raise an exception if all configured outputs raise exceptions. Also added theignore_individual_errors
option toout_copy
which simply changes how it configures itsOutputChain
.@repeatedly I'll still implement your idea of
buffer_ignore_exceeded_chunk
, but in a different pull-request, is that ok?