-
Notifications
You must be signed in to change notification settings - Fork 67
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
.fail() doesn't support complex payload #23
Comments
I think this is a good idea, and I just started to implement it, but now I remember why I didn't do it this way to begin with... A given job can retry any number of times, and so unlike But this concerns me because it wouldn't take too many retries (with e.g. deep stack traces) to start encroaching on the 16MB size limit of a single MongoDB document. And what about a job that fails 10 times and then succeeds? Should all of those failures be kept? |
I've implemented this as described above on the |
I must say that I would prefer if this would be an additional field to the log. So I would propose, that we have: |
I would not really worry about 16 MB limit. I think you would have to retry thousand times to start worrying about that. But then you have some other issue. And for periodic jobs you clone job documents anyway, no? |
Next you're going to ask that Like I said on the commit comment, I need to think about this. The goal should be to harmonize |
Good idea for There is an inherit difference between And yes, having |
So more I think more I would argue that |
produces strange message when error is not fatal:
I suggest you do |
Fixed! |
I've also added functionality to Also, per your request, These changes are currently on their own branch, but I plan to merge them into |
Hm, could you make also |
Isn't the fail object a data payload? |
Ah, now I see. You store failure data payload under |
At this point I'd really prefer not to break the document model. And changing Basically, I think it's suboptimal to force someone to filter through all of the log entries to find the failures. I think all of this confusion was seeded by my early decision to automatically write special "success" and "failure" log entries during Part of me wants to remove the "automatic" |
I agree.
That's why there is
I know that. But this why it is the last chance to break things before the 1.0 release. ;-) |
Anyway, I know how to wrap things for myself here around it. I just find it a bit cumbersome. I see that this should be simple one log for everything, and then you can have inside various types of log messages. Automatic message, custom message, failures, successes. And each log message could have both human readable and machine readable part. But this is only my view. It is your decision. It is good enough for me how it is now. |
I personally like having the result/failures data objects be top level attributes in the job document. Storing them in the log adds a level of redirection, and I'd prefer not to sift through a log that may contain a lot of things to find these really important data. I'm going to keep the "automatic" log entries for save/rerun/fail/done for now. but leave them undocumented. |
OK. |
Probably at some point it will be necessary to support customization of messages for those automatic log messages. At least translation to other languages comes to mind. |
Yet another reason to remove them! |
What about then create And then I can extend the class and make it log in the way it is currently logging, or with a translated string. Or whatever? So then log would be by itself always empty. Only Or maybe it would be even better to create generic hooks. |
I'm looking at this now. |
That looks amazing. Even better than I imagined! |
And this also plays well with stuff from |
I have nothing more to add. :-) If you will ever be around Berkeley, tell me and I am buying you a lunch. :-) |
Merged into master. |
While you can pass arbitrary data to
.done()
, you cannot pass it to.fail()
. Allowing only string message is problematic: I would like to store whole stacktrace, for example. Wouldn't it be useful to have at least a standardized way to store a stacktrace along the message (array of lines)? Or allow storing arbitrary data in the same way as.done()
?The text was updated successfully, but these errors were encountered: