lowcal: start timeout counter when sending requests, not when enqueueing them
The timeout property of a lowcal variable is redefined so as to refer to the time between sending a request and receiving a response. In other words, the time spent inside the send queue is not counted. Implementation-wise, this means we set the timeout counter when dequeueing the request, not when we enqueue it. This change avoids spurious errors (PROT_UMSG or PROT_2LATE) that happen when a varset has many multiplexers enqueued and a pending request times out due to a send error. In this case, enqueued requests will be sent (because the writer has higher priority than the timer) and then promptly times out; the response, when it arrives, will then cause one of the two error message above. Another advantage of the new scheme is that the timeout can now be configured without knowing how many multiplexers there are. Finally, the implementation is simplified, since we no longer need to remove elements from the queue, except the head. The functions unqueue and varsetq_remove are no longer used and have been removed. We could even go back to using a singly linked list for the send queue.
Please register or sign in to comment