def METHOD_NAME(exception=None):
    try:
        session.close()
    except Exception:
        # If session.close() fails the application is now totally useless:
        # the next request will fail to start a new transaction because we have
        # not closed the old one here. So we kill the entire process with
        # SIGABRT. The application container should spawn a fresh worker to
        # replace this one.
        # Note that the most likely failure here is MemoryError, so we must not
        # do any other work before we abort (not even logging a message)
        # because that could try to allocate, which will just fail again with
        # MemoryError.
        os.abort()