In req_rescq.c:req_confirmresv, after logging the event, the server replies to the client saying their reservation is confirmed. In doing so, it calls reply_ack, which frees the batch_request. After replying, the server accesses the batch_request to write to the accounting log.
In order to fix this, I’ve moved the accounting log recording code above the reply, though this brings to light a problem that wasn’t caught before: if the accounting log recording fails (in this case, due to a malloc call failing), the server returns and doesn’t send a response to the client, which is incorrect.
My question is, should the failure of the writing to the accounting log prevent the reservation from being confirmed? Do we reject the reservation? Or are the accounting logs not necessary for confirmation?
@mkaro said this on the pr conversation:
IMHO, failure to write an accounting record should prevent the reservation from being confirmed because the accounting log would be incomplete.