def release(self, session):
        """Release a machine session resource."""
        if session.state != SessionState.locked:
            return
        with self._lock():
            return self._power_down(session)