oetiker / znapzend

zfs backup with remote capabilities and mbuffer integration.
www.znapzend.org
GNU General Public License v3.0
608 stars 138 forks source link

Clause for $backupSet->{zend_delay} is processed even when expected to be unset #456

Closed jimklimov closed 3 years ago

jimklimov commented 4 years ago

One nuance that I found and debugged a bit, but did not fully unwrap in work on #454 (nor introduce there - likely exposed via #448), is:

Backup plan option 'zend-delay' has an invalid value (' ' is not a number) on backupSet tank/anothersource, ignored at /home/travis/build/oetiker/znapzend/t/../lib/ZnapZend.pm line 246.

which seems reported for all znapzend.t runs except for a couple that test custom codepaths regarding delays. The code for getting into this clause is

    if (defined($backupSet->{zend_delay})) {

so I assumed the hash entry to not exist if the zfs attribute is not there.

The "space" (or something that looks like it after print) probably comes from chomp... maybe... but how it passes defined in the first place - is the puzzle.

jimklimov commented 4 years ago

Per recent discussions: TODO: check if exists instead of, or in addition to, defined would handle such cases better...

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.