While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
self.conn.delete_stream(StreamName=self.stream_name)
        time.sleep(2)
class KinesisShard(Component):
    MAX_KEY = "340282366920938463463374607431768211455"
    def __init__(self, id):
        super(KinesisShard, self).__init__(id)
        self.stream = None
        self.start_key = "0"
        self.end_key = KinesisShard.MAX_KEY  
        self.child_shards = []
    def print_tree(self, indent=""):
        print("%s%s" % (indent, self))
        for c in self.child_shards:
            c.print_tree(indent=indent + "   ")
    def length(self):
        return int(self.end_key) - int(self.start_key)
    def percent(self):
        return 100.0 * self.length() / float(KinesisShard.MAX_KEY)
    def __str__(self):