Closed p5pRT closed 5 years ago
Storable rethrows errors from its hooks\, STORABLE_freeze\, STORABLE_thaw\, and STORABLE_attach. If those errors are refs\, they should be preserved in their original form. Tests were added to ensure this in 06f586d. However\, when Log::Agent is installed\, Storable uses it rather than just calling Carp::croak. Log::Agent's logcroak function always stringifies the errors it gets when it throws them. This causes test failures in many cases when the dual life dist is installed from CPAN.
A few CPAN Testers reports from this issue: https://www.cpantesters.org/cpan/report/00761375-6c0c-1014-946e-8eaf8038f308 https://www.cpantesters.org/cpan/report/8e51c42a-4cf5-11e8-b010-a35ca3102b3d https://www.cpantesters.org/cpan/report/c77a5184-4d6f-11e8-9bc9-021ad4cd031b https://www.cpantesters.org/cpan/report/84c75978-5e44-11e8-bbaf-bdf0d2eb68fb
This is a bug in Log::Agent\, but since it is long standing behavior in a non-core module\, I think it's reasonable to work around it in Storable. The optional use of Log::Agent seems pretty questionable to me in general\, but since it has been there for as long as Storable has existed in core it seemed reasonable to leave it in place.
The simplest workaround I could think of was to trap the error thrown by Log::Agent\, then throw the original arguments given to our logcroak.
Attached is a patch written against the sawyer/storable branch\, which is where the current CPAN releases have been cut from\, since blead is frozen.
Flags: category=library severity=low module=Storable
On Mon\, 28 May 2018 06:27:54 -0700\, haarg wrote:
Storable rethrows errors from its hooks\, STORABLE_freeze\, STORABLE_thaw\, and STORABLE_attach. If those errors are refs\, they should be preserved in their original form. Tests were added to ensure this in 06f586d. However\, when Log::Agent is installed\, Storable uses it rather than just calling Carp::croak. Log::Agent's logcroak function always stringifies the errors it gets when it throws them. This causes test failures in many cases when the dual life dist is installed from CPAN.
A few CPAN Testers reports from this issue: https://www.cpantesters.org/cpan/report/00761375-6c0c-1014-946e-8eaf8038f308 https://www.cpantesters.org/cpan/report/8e51c42a-4cf5-11e8-b010-a35ca3102b3d https://www.cpantesters.org/cpan/report/c77a5184-4d6f-11e8-9bc9-021ad4cd031b https://www.cpantesters.org/cpan/report/84c75978-5e44-11e8-bbaf-bdf0d2eb68fb
This is a bug in Log::Agent\, but since it is long standing behavior in a non-core module\, I think it's reasonable to work around it in Storable. The optional use of Log::Agent seems pretty questionable to me in general\, but since it has been there for as long as Storable has existed in core it seemed reasonable to leave it in place.
Removing (or disabling by default) the Log::Agent integration appeals to me.
Perhaps it could be enabled with something like:
use Storable '-logagent';
or something similar.
The simplest workaround I could think of was to trap the error thrown by Log::Agent\, then throw the original arguments given to our logcroak.
The patch isn't pretty\, but I think it's the only fix for this.
Tony
The RT System itself - Status changed from 'new' to 'open'
On Wed\, 30 May 2018 17:25:10 -0700\, tonyc wrote:
On Mon\, 28 May 2018 06:27:54 -0700\, haarg wrote:
Storable rethrows errors from its hooks\, STORABLE_freeze\, STORABLE_thaw\, and STORABLE_attach. If those errors are refs\, they should be preserved in their original form. Tests were added to ensure this in 06f586d. However\, when Log::Agent is installed\, Storable uses it rather than just calling Carp::croak. Log::Agent's logcroak function always stringifies the errors it gets when it throws them. This causes test failures in many cases when the dual life dist is installed from CPAN.
A few CPAN Testers reports from this issue: https://www.cpantesters.org/cpan/report/00761375-6c0c-1014-946e- 8eaf8038f308 https://www.cpantesters.org/cpan/report/8e51c42a-4cf5-11e8-b010- a35ca3102b3d https://www.cpantesters.org/cpan/report/c77a5184-4d6f-11e8-9bc9- 021ad4cd031b https://www.cpantesters.org/cpan/report/84c75978-5e44-11e8-bbaf- bdf0d2eb68fb
This is a bug in Log::Agent\, but since it is long standing behavior in a non-core module\, I think it's reasonable to work around it in Storable. The optional use of Log::Agent seems pretty questionable to me in general\, but since it has been there for as long as Storable has existed in core it seemed reasonable to leave it in place.
Removing (or disabling by default) the Log::Agent integration appeals to me.
Perhaps it could be enabled with something like:
use Storable '-logagent';
or something similar.
The simplest workaround I could think of was to trap the error thrown by Log::Agent\, then throw the original arguments given to our logcroak.
The patch isn't pretty\, but I think it's the only fix for this.
Tony
Patched applied. Resolving.
@xsawyerx - Status changed from 'open' to 'pending release'
Thank you for filing this report. You have helped make Perl better.
With the release today of Perl 5.30.0\, this and 160 other issues have been resolved.
Perl 5.30.0 may be downloaded via: https://metacpan.org/release/XSAWYERX/perl-5.30.0
If you find that the problem persists\, feel free to reopen this ticket.
@khwilliamson - Status changed from 'pending release' to 'resolved'
Migrated from rt.perl.org#133228 (status was 'resolved')
Searchable as RT133228$