Ticket #64 (defect)
Opened 1 year ago
Last modified 1 year ago
Race situation when cancelling
Status: closed (fixed)
| Reported by: | pvanhoof | Assigned to: | pvanhoof |
|---|---|---|---|
| Priority: | major | Milestone: | A first release |
| Component: | libtinymail-camel | Version: | 1.0 |
| Keywords: | Cc: | ||
Click three folders rapidly. If the operations cancel each other, you can often see this happening: Note a clean disconnect happens (LOGOUT is called), and therefore the disco is set to truly offline, Therefore is the next camel_service_connect a NOOP, and doesn't the account recover from the cancellation.
Also take a look at the locations where camel_imap_recon (store, ex) is called. It's this function that cancels and recovers the connection.
DS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {415}
(.., ..) <- * 1453 FETCH (FLAGS () UID 1530 INTERNALDATE " 3-Oct-2005 13:20:05 -0500" RFC822.SIZE 13906 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {285}
(.., ..) <- * 1454 FETCH (FLAGS () UID 1531 INTERNALDATE " 3-Oct-2005 14:46:37 -0500" RFC822.SIZE 4306 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {305}
(.., ..) <- * 1455 FETCH (FLAGS () UID 1532 INTERNALDATE " 3-Oct-2005 15:05:33 -0500" RFC822.SIZE 4734 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {416}
(.., ..) <- * 1456 FETCH (FLAGS () UID 1533 INTERNALDATE " 7-Oct-2005 06:29:23 -0500" RFC822.SIZE 4723 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {331}
(.., ..) <- * 1457 FETCH (FLAGS () UID 1534 INTERNALDATE " 3-Oct-2005 19:38:21 -0500" RFC822.SIZE 4722 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {358}
(.., ..) <- * 1458 FETCH (FLAGS () UID 1535 INTERNALDATE " 3-Oct-2005 19:56:48 -0500" RFC822.SIZE 4457 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {358}
(.., ..) <- * 1459 FETCH (FLAGS () UID 1536 INTERNALDATE " 7-Oct-2005 06:29:32 -0500" RFC822.SIZE 4727 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {367}
(.., ..) <- * 1460 FETCH (FLAGS () UID 1537 INTERNALDATE " 4-Oct-2005 00:00:31 -0500" RFC822.SIZE 4103 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {317}
(.., ..) <- * 1461 FETCH (FLAGS () UID 1538 INTERNALDATE " 4-Oct-2005 03:11:19 -0500" RFC822.SIZE 4322 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {354}
(.., ..) <- * 1462 FETCH (FLAGS () UID 1539 INTERNALDATE " 4-Oct-2005 03:16:01 -0500" RFC822.SIZE 32319 BODY[HEADER.FIELDS (DATE FROM TO CC SUBJECT MESSAGE-ID X-PRIORITY X-MSMAIL-PRIORITY X-MS-HAS-ATTACH CONTENT-TYPE)] {451}
imap_disconnect_online
imap_disconnect_offline
camel_imap_folder_start_idle
imap_connect_online
camel_imap_folder_stop_idle
(19, 19) -> E00000 CAPABILITY
imap_disconnect_online
imap_disconnect_offline
imap_connect_online
(19, 19) -> E00000 CAPABILITY
(.., ..) <- * CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH
(.., ..) <- E00000 OK Completed
(30, 30) -> E00001 LOGIN tnytest tnytest
(.., ..) <- E00001 OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH] User logged in
(19, 19) -> E00002 CAPABILITY
(.., ..) <- * CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH
(.., ..) <- E00002 OK Completed
(18, 18) -> E00003 NAMESPACE
(.., ..) <- * NAMESPACE (("INBOX." ".")) (("user." ".")) (("" "."))
(.., ..) <- E00003 OK Completed
Recon: No description available
(15, 15) -> E00004 LOGOUT
(.., ..) <- * BYE LOGOUT received
imap_disconnect_online
imap_disconnect_offline
Attachments
Change History
06/07/07 08:44:35: Modified by pvanhoof
06/07/07 08:46:50: Modified by pvanhoof
I also think that it's possible that this is caused by the fact that the cancellation happens while the current socket-situation is "while reconnecting". Maybe if the cancel happens while the last-canceled socket is currently in its reconnecting procedure, a clean logout happens and the disco folder is set to be offline.
06/07/07 08:51:01: Modified by pvanhoof
Look what I've found:
if (!connect_to_server_wrapper (service, ex) || !imap_auth_loop (service, ex))
{
CAMEL_DISCO_STORE (store)->status = CAMEL_DISCO_STORE_OFFLINE;
CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
/* camel_service_disconnect (service, TRUE, NULL); */
return FALSE;
}
I'm going to search for more such things.
06/07/07 08:55:16: Modified by anonymous
- status changed from new to closed.
- resolution set to fixed.
Revision 2092 fixes this. Although it needs a lot testing.
I'm closing this bug nevertheless, as I think my previous comment was indeed the cause of the problem.

FYI
tail docs/building.txt -n 14 | head -n 5 For debugging ------------- CFLAGS="-DDEBUG -DDBC -D_GNU_SOURCE -O0 -Wstrict-prototypes -Wall -g -ggdb" PKG_CONFIG_PATH=/opt/asyncworker/lib/pkgconfig \ ./autogen.sh --prefix=/opt/tinymail --enable-asyncworker --enable-tests --enable-unit-tests && make && sudo make install