From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eigenstate.org ([206.124.132.107]) by ewsd; Mon Dec 9 13:35:22 EST 2019 Received: from eigenstate.org (localhost [127.0.0.1]) by eigenstate.org (OpenSMTPD) with ESMTP id 8b07888c; Mon, 9 Dec 2019 10:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=eigenstate.org; h= message-id:to:date:subject:from:mime-version:content-type :content-transfer-encoding; s=mail; bh=4nFZqDgEf4DU7IXxXdCzOi490 wA=; b=FJhYeulRJluEi0ZvP2DZ4aEAm+OiPVpVPiJ/D0hntgijL0Sr6uGGu43iD XPiBoxlZFJ3O72Xkp3zckT0Af/DYzTsVtZe3EjvTxsWYjPKFs5mDe8tdUpBRvYRz SP/mB7Ofn6JGjUxv4/5zZmVqFvilSQiWhSrAgfMZEzBFbXi5kM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=eigenstate.org; h=message-id :to:date:subject:from:mime-version:content-type :content-transfer-encoding; q=dns; s=mail; b=FXC8wnE8VWzttCk3TJL qnuyw+a5OcNEmP/1Pi40YCKqQc01fL8U7+7IQrzsgTeTqpE8uj/Ou16OjTgh4p1c xBY1L4P/2UEqEQGDJe92XwcdzcYu7G1JC1UG/mEcN6MoooZhmq/MO5tCVghqVji9 CflafsOO1cBgOr3VgvdDT8Mw= Received: from abbatoir.hsd1.ca.comcast.net (c-76-21-119-139.hsd1.ca.comcast.net [76.21.119.139]) by eigenstate.org (OpenSMTPD) with ESMTPSA id 77327de9 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Mon, 9 Dec 2019 10:35:20 -0800 (PST) Message-ID: <01756337F576722545F2D4F171E99774@eigenstate.org> To: ori@eigenstate.org, cinap_lenrek@felloff.net, 9front@9front.org Date: Mon Dec 9 10:29:53 PST 2019 Subject: Re: [9front] [patch] upas: plumb flag updates on messages. From: ori@eigenstate.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: asynchronous reduce/map map/reduce-aware full-stack layer >> ok, small remarks. >> >> + if(doplumb){ >> + if((m->cstate & Cnew) && ensurecache(mb, m) == 0) >> msgdecref(mb, m); >> >> i think you want to do the msgdecref() of the message *after* mailplumb(), >> not before. otherwise its like free before use. i know with the current >> code it will still work but it is semantially wrong. if we later change >> how cache eviction works that will blow up. > > Ok. I was looking at the code, and it *seemed* like the intent was > to have even evicted messages be somewhat valid. I think there are a > number of places where we manipulate seen but not cached messages. > >> + print("child\n"); >> + if(mboxfile != nil) >> + if(err = newmbox(mboxfile, "mbox", 0, nil)) >> + sysfatal("opening %s: %s", mboxfile, err); > >> theres a debug print left there and this changes some semantics. >> i know this is because initial sync from imap takes forever. but >> people sometimes want to specify mailbox path at the initial >> command line and expect error status if the initial sync failed >> (like if mounting a mbox file in a script to parse a message). > > Right, forgot about this change. Reverted -- It doesn't even > make things respon faster, since the mount doesn't return until > after we do the initial sync. > >> i think a good compromise would be to add a commandline flag to >> specify if you want initial sync in the background or not >> (can then be added to /rc/bin/startupasfs). >> >> if we do background syncing, then even if the initial sync >> fails, it should try to continue. imagine your imap server >> is currently down or network is unavailable, you want it to >> continue trying in that case. and sysfataling here makes no >> sense as nobody will be listening. > > Yes. background sync will need a bunch more work, and a lot > more thought to get right. > > Updated patch below, slipped in 2 small changes: > > - Acme Mail => Next button to take you to the next msg > - Imap => small consistency tweak: flags are uint. > > Can back them out if you care about separating them. > + if((m->cstate & Cnew|Cmod) && ensurecache(mb, m) == 0){ And I attached the wrong version of the patch. The one I tested has (m->cstate & (Cnew|Cmod))