mapbox / ecs-watchbot

Make robots do your work for you
ISC License
195 stars 30 forks source link

add exit code for 'no-op, remove from queue' #148

Open perrygeo opened 7 years ago

perrygeo commented 7 years ago

Currently we can return either 0 or 3 in order to remove a message from the queue.

Let’s say the input Message is perfectly valid but the application doesn’t need to process it for whatever reason. Its not really a success (no output) and its not really a failure (if the job chose to continue, it would have succeeded). Depending on how you exit from such jobs, you might either be artificially inflating your log counts of true successes or true failures.

What about another exit code to cover this case?

Functionally exit X would behave just like exit 3 but the distinction might allow for more accurate log analysis. Think of it as a more polite exit 3 😄

cc @rclark @jakepruitt

rclark commented 7 years ago

The result here would actually be the same as exit 0: remove the message from the queue, don't consider the job a failure. Any reason you can't just use 0 for what you're imagining here? Perhaps the application logs themselves would be the thing that would inform you as to whether or not it was a no-op?