From f6509f4354cf6afb7d1d0e24351e8c0c26aaca71 Mon Sep 17 00:00:00 2001 From: Osama Haggag Date: Thu, 18 Jun 2015 13:45:56 +0200 Subject: [PATCH] Adjust to java example. Break on non-retryable exceptions. --- samples/sample_kclpy_app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/sample_kclpy_app.py b/samples/sample_kclpy_app.py index 0d0970c..09cc663 100644 --- a/samples/sample_kclpy_app.py +++ b/samples/sample_kclpy_app.py @@ -74,8 +74,10 @@ def checkpoint(self, checkpointer, sequence_number=None): print('Was throttled while checkpointing, will attempt again in {s} seconds'.format(s=self.SLEEP_SECONDS)) elif 'InvalidStateException' == e.value: sys.stderr.write('MultiLangDaemon reported an invalid state while checkpointing.\n') + return else: # Some other error sys.stderr.write('Encountered an error while checkpointing, error was {e}.\n'.format(e=e)) + return time.sleep(self.SLEEP_SECONDS) def process_record(self, data, partition_key, sequence_number):