'Stop the user\'s spawner
and cleanup after it.'

@gen.coroutine
def stop(self, server_name=''):

    spawner = self.spawners[server_name]
    spawner._spawn_pending = False
    spawner.stop_polling()
    spawner._stop_pending = True
    try:
        api_token = spawner.api_token
        status = (yield spawner.poll())
        if (status is None):
            (yield spawner.stop())
        spawner.clear_state()
        spawner.orm_spawner.state = spawner.get_state()
        self.last_activity = spawner.orm_spawner.last_activity = datetime.utcnow()
        spawner.server = None
        if (not spawner.will_resume):
            orm_token = orm.APIToken.find(self.db, api_token)
            if orm_token:
                self.db.delete(orm_token)
        self.db.commit()
    finally:
        auth = spawner.authenticator
        try:
            if auth:
                (yield gen.maybe_future(auth.post_spawn_stop(self, spawner)))
        except Exception:
            self.log.exception('Error    in    Authenticator.post_spawn_stop    for    %s', self)
        spawner._stop_pending = False
