On Mar 7, 2007, at 7:50 , Stas Khirman wrote:
> It's seems that observers are not treated well when arrive into
> m_aborted_transactions list: they well be quietly destroyed ( in
> tick())
> without calling appropriate timeout() or abort() methods.
>
> IMHO, it will be much clean if in case or transaction array overload ,
> oldest observer removed after calling for its timeout(). Btw,
> probably I'm
> missing something, but I see no real reason for
> m_aborted_transactions list
> at all - why not just remove pointer after timeout() call ?
The m_aborted_transactions is only used if the array of pending
transactions fills up. This is supposed to be a very rare case, since
the array can hold 2048 entries. i.e. if 2048 requests are sent
before the first of them times out.
In this case, the array may be completely full, and cannot fit
another request. The oldest request is then removed without calling
timeout(), because timeout() will likely trigger another request
(that's how most algorithms work, refresh, find_nodes etc.). So,
timeout() cannot be called on the aborted observer. It will disrupt
the algorithm the request belongs to, and it may even silently cancel
it (making the callback for that algorithm never to be called, if all
branches of that algorithm are canceled).
The reason why they are put in a separate vector is to not destruct
them while we're in the middle of allocating a new slot for a message.
--
Arvid Norberg
|