Skip to content

Avoid queueing redundant DB tasks during sync

akwizgran requested to merge 1162-redundant-db-tasks into master

This branch modifies DuplexOutgoingSession to avoid having more than one DB task of each type in the database executor's queue at any time. This reduces the load on the DB when syncing a lot of messages.

I considered moving the task-tracking logic into a separate class shared between sessions with the same contact, but that would lead to a situation where the first session to start retrieving a set of new messages (or acks, etc) from the DB would retrieve all of them while the other sessions remained idle.

Needs backport.

Closes #1162 (closed)

Edited by akwizgran

Merge request reports