RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1021191 - IDLE protocol don't use idled (idle method), but poll method; thousands forgotten {configdirectory}/socket/idle.<pid> files
Summary: IDLE protocol don't use idled (idle method), but poll method; thousands forgo...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cyrus-imapd
Version: 6.4
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Pavel Zhukov
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-20 09:31 UTC by Michal Michaláč
Modified: 2017-07-19 09:29 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-19 09:29:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Michal Michaláč 2013-10-20 09:31:54 UTC
Description of problem:
a)
Idled method is used only first time in imapd process live. Then poll method is used.
After starting, imapd process creates own unix socket {configdirectory}/socket/idle.<pid> (by call idle_enabled()). After e-mail client connect to it and issue IDLE command, imapd waits for notification of new mail (form lmtpd for example). 
After new mail arrives, lmtpd notifies imapd about it and imapd immediately notifies client. Ok so far.

But then imapd calls idle_done() which closes (and removes) {configdirectory}/socket/idle.<pid>. This is problem.
After client issue IDLE command again, imapd can't communicate with closed socket and use "poll" method to check updates to mailbox.
It means, client will be notified about next new mail after (max) 'imapidlepoll' time (default 60s).

b) 
In {configdirectory}/socket/ remains thousands of idle.<pid> files. If pop3d proces is started, it creates own idle.<pid> file (by call idle_enabled()), but this file is never removed. Neither after terminating of pop3d. 
Other cyrus-imapd processess (imapd, lmtpd) leaves idle.<pid> too. Only situation, where idle.<pid> is removed is described in (a).



Version-Release number of selected component (if applicable):
cyrus-imapd-2.3.16-6.el6_2.5

How reproducible:
Easy

Steps to Reproduce:
Will test on mailbox name 'johndoe'. /etc/imapd.conf:imapidlepoll setting is default (60s).

1) Clean idle.* sockets and restart.
$ service cyrus-imapd stop
$ rm /var/lib/imap/socket/idle.* -f
$ service cyrus-imapd start

2) Enable protocol debugging for johndoe.
$ cd /var/lib/imap/log/
$ mkdir johndoe
$ chown cyrus

3) Connect to imap by email-client (I use Mozilla Thunderbird)
$ tail -f johndoe/*
here you will see, Thunderbird issue IDLE command
$ ls -l /var/lib/imap/socket/idle.*
here you will see socket of our imapd process

4) Send first mail to johndoe's mailbox.
$ echo test | mail johndoe
at tail screen you will see immediately notification about new mail (and this mail is downloaded to Thunderbird). Ok so far.
$ ls -l /var/lib/imap/socket/idle.*
Here you will see socket of our imapd process disapeared.

5) Send second mail...
$ echo test | mail johndoe
at tail screen you will see notification about new mail appears after random delay (0 - 60s) because poll not idled.

6) Terminate cyrus-imapd and count imapd.* leaved
$ service cyrus-imapd stop
$ ls -l /var/lib/imap/socket/imap.*


Actual results:
a) after first IDLE notification using idled, next is deferred by poll mechanism
b) many imap.* files remains

Expected results:
a) every time use idled IDLE notifications 
b) at {configdirectory}/socket/ must be only idle.* sockets of running process, not of terminated

Additional info:
This problem was involved by idle* patch (last patch in cyrus-imapd-2.3.16-6.el6_2.5). Before that, processes communicate via single {configdirectory}/socket/idle socket. 

Thank you
Michal Michaláč

Comment 2 sysadmin 2014-02-28 14:53:19 UTC
I too get a /var/lib/imap/socket directory cluttered with idle.* files.  In addition, when restarting cyrus-imapd, I get many of these, not sure if related:

Feb 28 09:41:33 myhostname idled[9472]:  error sending to idled: 4

Comment 3 g.danti 2015-05-06 14:49:15 UTC
I have the same exact bug. Any suggestion on how to fix it?

Comment 4 seiichirou.hiraoka 2015-05-23 13:17:45 UTC
I use RHEL 7.1 and Cyrus-IMAPD 2.5.2 (source compile)

When I log in thunderbird to cyrus-imapd imap service,
I see following error message in my /var/log/messages.

May 23 22:04:35 servername imap[4280]: IDLE: error sending message INIT to idled for
mailbox user.username: No such file or directory. Falling back to polling every
60 seconds.

So I add my /etc/imapd.conf

imapidlepoll: 0

and message stopped.

I want to know...
1) Is my situation as same as this BUG?
2) Is my workaround cause another problem?

Any comments are welcome.

Thanks,

Comment 5 Pavel Šimerda (pavlix) 2015-12-01 16:10:06 UTC
Do we have any upstream information for that?

Comment 6 Boris Folgmann 2016-01-14 10:33:04 UTC
Sorry for clearing the flag. I wanted just to CC since I'm experiencing the same behaviour. Any news on this bug?

Comment 11 Pavel Zhukov 2017-04-13 10:13:21 UTC
(In reply to Pavel Šimerda (pavlix) from comment #5)
> Do we have any upstream information for that?
Looks like addressed in:
https://github.com/cyrusimap/cyrus-imapd/commit/c024aa361060ea3e3e18efd0ea056d953eb204c5

Comment 12 Pavel Zhukov 2017-07-19 09:29:55 UTC
Red Hat Enterprise Linux 6 transitioned to the Production 3 Phase on May 10, 2017.  During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:
http://redhat.com/rhel/lifecycle

This issue does not appear to meet the inclusion criteria for the Production Phase 3 and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification.  Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com


Note You need to log in before you can comment on or make changes to this bug.