diff mbox series

[OSSTEST,29/60] parallel by fork: Disconnect $dbh_tests as well as undefing it

Message ID 20200814172205.9624-30-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Speed up sg-report-job-history | expand

Commit Message

Ian Jackson Aug. 14, 2020, 5:21 p.m. UTC
If the caller is buggy and has statement handles still open, they can
still "work" even if we have thrown away the db handle.

Where, after forking, "work" means "use the same connection in
multiple processes simultaneously, without locking".  This could
result in arbitrary crazy nbehaviour (eg, TLS crypto failures).

No functional change with existing callers since they don't have this
bug.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Osstest/HistoryReport.pm | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/Osstest/HistoryReport.pm b/Osstest/HistoryReport.pm
index 0b206de4..f0571189 100644
--- a/Osstest/HistoryReport.pm
+++ b/Osstest/HistoryReport.pm
@@ -245,6 +245,7 @@  sub parallel_by_fork ($$$$) {
     # db is reopened in each child.
 
     $whoami = $set_whoami;
+    $dbh_tests->disconnect();
     undef $dbh_tests;
 
     foreach my $task (@$tasks) {