# File src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/transaction.rb, line 125
    def close
      return if !@connection

      @connection.synchronize do
        return if !@connection.connected?

        begin
          io_operation do
            # We need an ACK here so that we the UstRouter doesn't end up
            # processing the Core's openTransaction and closeTransaction pair
            # before it has received this process's openTransaction command.
            @connection.channel.write('closeTransaction', @txn_id,
              Utils.encoded_timestamp, true)
            Utils.process_ust_router_reply(@connection.channel,
              "Error handling reply for 'closeTransaction' message")
          end
        ensure
          @connection.unref
          @connection = nil
        end
      end
    end