Ticket #4385 defect closed fixed

Opened 4 years ago

Last modified 4 years ago

IMAP4 server loops indefinitely if a search query yields more than 4 items

Reported by: wulczer Owned by:
Priority: normal Milestone:
Component: mail Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

The responsible code seems to be

if i == 4:
    from twisted.internet import reactor
    reactor.callLater(
        0, self.__cbManualSearch, result, tag, mbox, query, uid,
        searchResults)

in IMAP4Server.cbManualSearch.

It seems to me that it should be slicing the first four items off the result list before calling itself again.

Attachments

twisted-4385-imap4-loop.patch Download (2.8 KB) - added by wulczer 4 years ago.
patch to fix the issue
twisted-4385-imap4-loop-v2.patch Download (4.5 KB) - added by wulczer 4 years ago.
rebased patch to trunk

Change History

Changed 4 years ago by wulczer

patch to fix the issue

1

  Changed 4 years ago by wulczer

  • owner exarkun deleted
  • keywords review added

2

follow-up: ↓ 3   Changed 4 years ago by therve

  • owner set to wulczer
  • keywords review removed

DefaultSearchTestCase.test_searchAndMessageSet is freezing for me. The patch doesn't seem to be again latest trunk, maybe it's the problem?

Changed 4 years ago by wulczer

rebased patch to trunk

3

in reply to: ↑ 2   Changed 4 years ago by wulczer

  • keywords review added
  • owner wulczer deleted

Replying to therve:

DefaultSearchTestCase.test_searchAndMessageSet is freezing for me. The patch doesn't seem to be again latest trunk, maybe it's the problem?

Yes, you're right, the patch was bad. I rebased it against latest trunk (attached).

4

  Changed 4 years ago by exarkun

  • owner set to exarkun
  • keywords review removed
  • status changed from new to assigned

Thanks. The patch looks good. I'll apply it.

5

  Changed 4 years ago by exarkun

  • status changed from assigned to closed
  • resolution set to fixed

(In [28818]) Apply twisted-4385-imap4-loop-v2.patch to fix the infinite loop in IMAP4 server search handling

Author: wulczer Reviewer: therve, exarkun Fixes: #4385

Previously the fallback search implementation provided by IMAP4Server would examine the first five messages in a mailbox forever, trying to respond to a search command. This fixes it to actually iterate over all the messages in the mailbox and eventually complete.

6

  Changed 3 years ago by <automation>

  • owner exarkun deleted
Note: See TracTickets for help on using tickets.