Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] rustify parts of job and imap handling, introduce Delay and ImapResult enums like in C #400

Closed
wants to merge 10 commits into from

Conversation

hpk42
Copy link
Contributor

@hpk42 hpk42 commented Aug 19, 2019

removes "ok_to_continue" logic -- for reviewing lookings at non-cargo-fmt commits might be better. Or reviewing the end result of the changed functions and comparing them with C.

src/constants.rs Outdated Show resolved Hide resolved
@hpk42 hpk42 changed the title rustify dc job send rustify parts of job and imap handling, introduce Delay and ImapResult enums like in C Aug 20, 2019
Ok(_) => {}
Err(err) => {
info!(context, 0, "Cannot copy message. {:?}", err);
return ImapResult::Failed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should do a

return if !self.should_reconnect() {
                ImapResult::Failed
            } else {
                ImapResult::RetryLater
            };

here as well. otherwise, if network does away during copy, the message is never tried to copy again.

maybe it is also better to add the same check after mv-failing already - if it turnes out, network is away after move, trying over with copy+delete mayl raise the risk in a flaky network situation that one of these part fails.

@hpk42 hpk42 changed the title rustify parts of job and imap handling, introduce Delay and ImapResult enums like in C [wip] rustify parts of job and imap handling, introduce Delay and ImapResult enums like in C Aug 20, 2019
@hpk42
Copy link
Contributor Author

hpk42 commented Aug 23, 2019

closing this PR but the branch remains in active development -- working with @r10s on larger scale changes on it: introducing perform_mvbox_jobs to make all jobs that do things with mvbox actually use the mvbox thread -- this way inbox thread does not have to select mvbox folder and then select back etc. -- it not only decreases network traffic but also decreases the dependency on interrupt_idle working in several situations. (right now, all imap jobs on all folders are running the perform_imap_jobs (to be renamed to perform_inbox_jobs at some point) action). This all came about because we couldn't do certain things because of hangings in the tests because we can't reliably interrupt idle, see jonhoo/rust-imap#132

@hpk42 hpk42 closed this Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants