flight_otherjob
main_revision_job_cond other_revision_job_suffix
$dbh_tests db_retry db_retry_retry db_retry_abort
+ db_readonly_report
db_begin_work db_prepare
get_harness_rev
ensuredir get_filecontents_core_quiet system_checked
$mjobdb->begin_work($dbh, $tables);
}
+# call this after db_begin_work or just at the top of a db_retry
+# db transaction will be readonly and suitable for a longrunning report
+sub db_readonly_report (;$) {
+ my ($dbh) = @_;
+ $dbh //= $dbh_tests;
+ $mjobdb->readonly_report($dbh);
+}
+
sub db_retry ($$$;$$) {
# $code should return whatever it likes, and that will
# be returned by db_retry
# https://www.postgresql.org/message-id/flat/D960CB61B694CF459DCFB4B0128514C203937E44%40exadv11.host.magwien.gv.at
}
+sub readonly_report ($$) { #method
+ my ($jd, $dbh) = @_;
+
+ $dbh->do("SET TRANSACTION READ ONLY DEFERRABLE");
+}
+
sub current_flight ($) { #method
return $ENV{'OSSTEST_FLIGHT'};
}
sub new { return bless {}, $_[0]; };
sub begin_work { }
+sub readonly_report { }
sub need_retry ($$$) {
my ($jd, $dbh,$committing) = @_;
return $committing;
}
db_retry($dbh_tests, [], sub {
+ db_readonly_report();
if (defined $mro) {
open MRO, "> $mro.new" or die "$mro.new $!";
}
}
db_begin_work($dbh_tests, []);
+db_readonly_report();
foreach my $j (@jobs) { processjob($j); }