[pmg-devel] applied: [PATCH log-tracker] fix mutable borrow panic on duplicate msgid

Thomas Lamprecht t.lamprecht at proxmox.com
Tue May 11 16:16:43 CEST 2021


On 29.04.21 15:25, Mira Limbeck wrote:
> Because of the relay before lmtp issue we now add and remove QEntrys
> based on their message-id. But if the cleanup line containing the
> message-id appears twice in the log for the same QEntry it keeps a weak
> reference to itself which leads to a panic because of a mutable borrow
> while it is already mutably borrowed in the 'finalize' function.
> 
> To circumvent this we check after the lookup if it is the same QEntry
> and if so, insert it again with that message-id in the lookup table and
> don't add the weak reference.
> 
> Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
> ---
>  src/main.rs                                   | 11 ++++-
>  tests/test_input_after_queue_duplicate_msgid  | 20 +++++++++
>  tests/test_output_after_queue_duplicate_msgid | 45 +++++++++++++++++++
>  tests/tests_after_queue.rs                    | 23 ++++++++++
>  4 files changed, 97 insertions(+), 2 deletions(-)
>  create mode 100644 tests/test_input_after_queue_duplicate_msgid
>  create mode 100644 tests/test_output_after_queue_duplicate_msgid
> 
>

applied, with Aarons T-b, thanks!




More information about the pmg-devel mailing list