From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63311: 30.0.50; [PATCH] smtpmail-send-it split Date: Wed, 01 Nov 2023 20:55:37 +0100 Message-ID: <87lebhckp2.fsf@ledu-giraud.fr> References: <87jzxmsyyr.fsf@ledu-giraud.fr> <83ttwqhahy.fsf@gnu.org> <874joq34bk.fsf@ledu-giraud.fr> <83o7mygevr.fsf@gnu.org> <87wn1hzv9j.fsf@ledu-giraud.fr> <871qjoe7cw.fsf@ledu-giraud.fr> <837ctf575q.fsf@gnu.org> <87ilcypot3.fsf@ledu-giraud.fr> <83pm763y3r.fsf@gnu.org> <87h6si5aor.fsf@ledu-giraud.fr> <83a5ya3u16.fsf@gnu.org> <871qjm56ej.fsf@ledu-giraud.fr> <87r0l9ejmm.fsf@ledu-giraud.fr> <834ji5aatw.fsf@gnu.org> <87bkcde4bz.fsf@ledu-giraud.fr> <83r0l98e6w.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38662"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63311@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 01 20:56:39 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qyHKR-0009oj-3n for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Nov 2023 20:56:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyHKH-00071B-B5; Wed, 01 Nov 2023 15:56:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyHKF-0006wT-VV for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2023 15:56:28 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyHKF-0007rZ-NO for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2023 15:56:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyHKo-0003EO-2h for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2023 15:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Nov 2023 19:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63311 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 63311-submit@debbugs.gnu.org id=B63311.169886858612369 (code B ref 63311); Wed, 01 Nov 2023 19:57:02 +0000 Original-Received: (at 63311) by debbugs.gnu.org; 1 Nov 2023 19:56:26 +0000 Original-Received: from localhost ([127.0.0.1]:52670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyHKA-0003DN-CB for submit@debbugs.gnu.org; Wed, 01 Nov 2023 15:56:26 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:20158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyHK4-0003D7-DA for 63311@debbugs.gnu.org; Wed, 01 Nov 2023 15:56:21 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=HzwMz0JG AcYRco1tyhfK+QrfPYrYVBlIv81X8sn0LPA=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=LLyFKC8ZDNtDP6FQmhj3Epd9Y1Cy1m 8uVLz+saexMRk6CM+qm0rFxqLEvSGpnw1haUAYc/5y6SELMh1+73cBBA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=HzwMz0JGAcYRco1t yhfK+QrfPYrYVBlIv81X8sn0LPA=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=JImoTfPOpVCcWJ9Y5Sb2Zz8YypVGE7Rjpq0Poo rMmup/ZuVmgI6ObrPnnjowP4PATFogmfm95Ww3F1whJzG8iSVAlaX3A1x5awU4CQ/JXF0e 71Slzyq4ZU1locVzrhNy49UkvBy9E80hIzg/8dMCXB1Jec199AAzyX5bEu/fb2yD92Ez7y EaCMQN8Si8Qu+FvwtWT41vTRhGjII2wbZJJ3p6FSrPfIHtWdqiuUyczUpmu1l/ib5ourfU OSaSpWDFwECnvaFStvkvHaSWZnc1ZTroyX/9dMf3n354eaSYAULDrTZqmn72e41r3hhv9c R93TWX8yguxVvHmHY2RvsUsQ== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 21f23e6f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 1 Nov 2023 20:55:39 +0100 (CET) In-Reply-To: <83r0l98e6w.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 01 Nov 2023 21:29:43 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273621 Archived-At: Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: 63311@debbugs.gnu.org >> Date: Wed, 01 Nov 2023 19:06:08 +0100 >> >> Eli Zaretskii writes: >> >> > . I'm not sure I understand how will the success/failure of sending >> > be communicated back to the callers. Currently, when the sending >> > succeeds, there's a message in echo-area, and if the message was a >> > reply, then Emacs marks the original message as "have been replied >> > to". How will this work with async sending? >> >> The progress and "Sending email done" still shows in echo-area and >> *Messages* buffer but asynchronously. > > What happens if the foreground Lisp program displays something in the > echo-area at that time? I'm asking because I don't think it's a good > idea to show this from a background thread. Sorry I did not test this. But maybe when this starts working, we should consider removing the progress report for large messages. >> > . What happens if sending fails for some reason? It could be that >> > the problem is detected by smtpmail itself, or it could be that >> > some low-level code signals an error -- what happens in both >> > cases? >> >> Some errors should be handled in 'smtpmail-send-mail' and signal by >> calling (error). But other errors won't be. For instance, I tried to >> send a mail to a non existent address and I get no error whatsoever: the >> buffer is also called "*sent ...*" > > Signaling an error in a non-main thread causes the thread exit > silently, with the error stored in a variable, so something should be > done to show the error to the user. Yes, I have seen that and just learn about 'thread-signal'. >> > . What happens if another message is sent while the previous one is >> > still being sent? >> >> That I have tested. It works because the temporary buffer where >> everything takes place is generated by 'generate-new-buffer' which >> creates a unique name if needed. > > So you have several threads sending at the same time? If so, what > happens with their errors and success messages? Their was no errors because those sendings did not generate any. The success messages appeared in the *Messages* buffer. >> > For that matter, how long did it take for the background thread to >> > send the message? If that was short enough, like 1 sec or so, I >> > suggest to test this with sending a larger message, like a message >> > with a large attachment. That's because the most important >> > situation where async sending is valuable is when it takes a long >> > time to send a message, either because it's a large message or >> > because the connection is slow or unreliable. >> >> Yes I have tested with longer to send message otherwise I would not be >> able to see the asynchronous process. > > If you don't see problems with responsiveness, this is encouraging. > IME, such problems happen quite frequently, for example if you type > during the time the background thread does its job. Yes this is just a start and should be tested on normal/regular usage. As always, when I start working on this I rediscover that there is many housekeeping done afterward by the 'smtpmail-send-it' callers (marking as sent via mail,...): this should be taken into account too. So it may be encouraging but I think this is just a start. -- Manuel Giraud