public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 2/3] server/email_notifications: do not panic on template registration
Date: Thu, 18 Mar 2021 11:21:12 +0100	[thread overview]
Message-ID: <cf178285-907e-b68a-3ac9-860077a0748b@proxmox.com> (raw)
In-Reply-To: <e8af81f6-0e6a-3cca-b089-884ddcc12f6f@proxmox.com>

On 18.03.21 10:57, Dominik Csapak wrote:
> On 3/17/21 20:38, Thomas Lamprecht wrote:
>> On 16.03.21 12:56, Dominik Csapak wrote:
>>> instead print an error and continue, the rendering functions will error
>>> out if one of the templates could not be registered
>>>
>>> if we `.unwrap()` here, it can lead to problems if the templates are
>>> not correct, i.e. we could panic while holding a lock, if something holds
>>> a mutex while this is called for the first time
>>
>> how can they error?
>> And any error (with or without this patch) would lead to emails notification not
>> working anymore, some may seem this as quite fatal error if they do not get notified
>> on erroneous jobs anymore? We may not be able to do much here, that's why above
>> question about what the error source can be.
> 
> they can error if they do not compile, e.g. they have syntax errors
> while we should catch that during developement/reviewing,
> if it does happen, it generates some weird behaviour
> (for example panicing while holding a mutex)

can't we just add a test for that instead, so that it is actually "compile checked"
when building a package?

Then such errors would be actually fixed before getting released, relying on
review/test tends to fail and let slip something trhough sooner or later.
> 
> with my patch, we still generate a warning, but aside from
> sending notification mails (where we still would warn in the log)
> the rest should work fine, there we can ofc also error out on
> notification errors so that the tasks get an error
> (but a well defined one instead of a panic)
> 
> also we may want to put the templates into files in the future
> so that users can adapt it and we can more easily change
> them (maybe localize them?)
> 

would need a sane reload mechanism then though, and in any way the one we ship
should be tested for basic validity on build.




  reply	other threads:[~2021-03-18 10:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 11:56 [pbs-devel] [PATCH proxmox-backup 1/3] tools/systemd/time: implement some Traits for TimeSpan Dominik Csapak
2021-03-16 11:56 ` [pbs-devel] [PATCH proxmox-backup 2/3] server/email_notifications: do not panic on template registration Dominik Csapak
2021-03-17 19:38   ` Thomas Lamprecht
2021-03-18  9:57     ` Dominik Csapak
2021-03-18 10:21       ` Thomas Lamprecht [this message]
2021-03-18 10:31         ` Dominik Csapak
2021-03-18 11:13           ` Thomas Lamprecht
2021-03-16 11:56 ` [pbs-devel] [PATCH proxmox-backup 3/3] api2/tape/backup: include a summary on notification e-mails Dominik Csapak
2021-03-17 19:35 ` [pbs-devel] [PATCH proxmox-backup 1/3] tools/systemd/time: implement some Traits for TimeSpan Thomas Lamprecht
2021-03-18  9:49   ` Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf178285-907e-b68a-3ac9-860077a0748b@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal