diff options
author | Étienne Deparis | 2017-10-15 16:41:59 +0200 |
---|---|---|
committer | Étienne Deparis | 2017-10-15 16:41:59 +0200 |
commit | 8df4f6e6d1a17c1fcff2bc7512a7b928194f7659 (patch) | |
tree | b4f2e275a2d2f9a534c51b37b6d5e9cb621b2078 | |
parent | 851de76eddf519fcaeb74688358caa9d8f32c4a7 (diff) | |
download | aur-8df4f6e6d1a17c1fcff2bc7512a7b928194f7659.tar.gz |
Add another patch to stabilize build
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | make_SystemResourceMonitor.stop_more_resilient_to_errors.patch | 119 |
3 files changed, 131 insertions, 5 deletions
@@ -1,9 +1,9 @@ # Generated by makepkg 5.0.2 -# Mon Sep 18 18:06:56 UTC 2017 +# Sun Oct 15 14:41:23 UTC 2017 pkgbase = cliqz pkgdesc = Firefox-based privacy aware web browser, build from sources pkgver = 1.15.1 - pkgrel = 1 + pkgrel = 2 url = https://cliqz.com/ arch = i686 arch = x86_64 @@ -45,6 +45,7 @@ pkgbase = cliqz source = harmony-fix.diff source = no-crmf.diff source = glibc-2.26-fix.diff + source = make_SystemResourceMonitor.stop_more_resilient_to_errors.patch sha256sums = 5f0ffe83a7db3608840895dc0fda57ebcc42a6581e3564ffc730f7daa3162803 sha256sums = f068b84ad31556095145d8fefc012dd3d1458948533ed3fff6cbc7250b6e73ed sha256sums = e98a3453d803cc7ddcb81a7dc83f883230dd8591bdf936fc5a868428979ed1f1 @@ -52,6 +53,7 @@ pkgbase = cliqz sha256sums = 16bb776e9f3039321db747b2eaece0cda1320f3711fb853a68d67247b0aa065d sha256sums = fb85a538044c15471c12cf561d6aa74570f8de7b054a7063ef88ee1bdfc1ccbb sha256sums = cd7ff441da66a287f8712e60cdc9e216c30355d521051e2eaae28a66d81915e8 + sha256sums = 7760ebe71f4057cbd2f52b715abaf0d944c14c39e2bb2a5322114ad8451e12d9 pkgname = cliqz @@ -2,7 +2,7 @@ pkgname=cliqz _pkgname=browser-f pkgver=1.15.1 -pkgrel=1 +pkgrel=2 _cqzbuildid=20170908115024 pkgdesc="Firefox-based privacy aware web browser, build from sources" arch=(i686 x86_64) @@ -19,14 +19,16 @@ source=("https://github.com/cliqz-oss/browser-f/archive/${pkgver}.tar.gz" clip-ft-glyph.diff harmony-fix.diff no-crmf.diff - glibc-2.26-fix.diff) + glibc-2.26-fix.diff + make_SystemResourceMonitor.stop_more_resilient_to_errors.patch) sha256sums=('5f0ffe83a7db3608840895dc0fda57ebcc42a6581e3564ffc730f7daa3162803' 'f068b84ad31556095145d8fefc012dd3d1458948533ed3fff6cbc7250b6e73ed' 'e98a3453d803cc7ddcb81a7dc83f883230dd8591bdf936fc5a868428979ed1f1' 'd5e5580a96ecc4a66ce12dde0737c1ed5cb31017a6ec488ffe372192ed893e1b' '16bb776e9f3039321db747b2eaece0cda1320f3711fb853a68d67247b0aa065d' 'fb85a538044c15471c12cf561d6aa74570f8de7b054a7063ef88ee1bdfc1ccbb' - 'cd7ff441da66a287f8712e60cdc9e216c30355d521051e2eaae28a66d81915e8') + 'cd7ff441da66a287f8712e60cdc9e216c30355d521051e2eaae28a66d81915e8' + '7760ebe71f4057cbd2f52b715abaf0d944c14c39e2bb2a5322114ad8451e12d9') options=(!emptydirs !makeflags !strip) prepare() { @@ -64,6 +66,9 @@ END # https://bugzilla.mozilla.org/show_bug.cgi?id=1400721 patch -Np1 -i $srcdir/harmony-fix.diff + # https://bugzilla.mozilla.org/show_bug.cgi?id=1384062 + patch -Np1 -i $srcdir/make_SystemResourceMonitor.stop_more_resilient_to_errors.patch + # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) # Note: These are for Arch Linux use ONLY. For your own distribution, please # get your own set of keys. Feel free to contact foutrelis@archlinux.org for diff --git a/make_SystemResourceMonitor.stop_more_resilient_to_errors.patch b/make_SystemResourceMonitor.stop_more_resilient_to_errors.patch new file mode 100644 index 000000000000..ff75dcfd0c86 --- /dev/null +++ b/make_SystemResourceMonitor.stop_more_resilient_to_errors.patch @@ -0,0 +1,119 @@ + +# HG changeset patch +# User Mike Hommey <mh+mozilla@glandium.org> +# Date 1502856976 -32400 +# Node ID 8d9ae8c45dd07496f164364f24c5f43edcf2eb6e +# Parent fa02d334033f0039ef82b3d7dc194312ba250279 +Bug 1384062 - Make SystemResourceMonitor.stop more resilient to errors. r=ahal,gps + +The poll() call in SystemResourceMonitor.stop might fail even though +there is something to read from the pipe, in some corner cases, and +python won't let us know about it. In that case, an exception is thrown, +leaving the SystemResourceMonitor (and its callers) in a weird state. In +practice, this leads BuildMonitor.__exit__ to recall stop, which then +fails. + +So when poll() throws an exception, we pretend there's still something +to read, and we try to read anyways. If there is something to read, +recv() will return it, otherwise, it will throw an exception of its own, +which we catch, pretending we're done. + +Furthermore, when there is nothing to read from the pipe, poll() simply +returns False, and our loop never sets `done` to True, and we then hit +an assert, which doesn't have its place here, so we remove it. + +Finally, the other end of the pipe might have died at any time, making +sending over the pipe fail, so we also protect against that. + +With all these changes, it feels like the reason to backout bug 1239939 +in bug 1272782 should have been dealt with, and we can drop the timeout +again. + +diff --git a/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py b/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py +--- a/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py ++++ b/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py +@@ -284,57 +284,71 @@ class SystemResourceMonitor(object): + """ + if not self._process: + self._stopped = True + return + + assert self._running + assert not self._stopped + +- self._pipe.send(('terminate',)) ++ try: ++ self._pipe.send(('terminate',)) ++ except Exception: ++ pass + self._running = False + self._stopped = True + + self.measurements = [] + +- done = False +- + # The child process will send each data sample over the pipe + # as a separate data structure. When it has finished sending + # samples, it sends a special "done" message to indicate it + # is finished. +- while self._pipe.poll(1.0): +- start_time, end_time, io_diff, cpu_diff, cpu_percent, virt_mem, \ +- swap_mem = self._pipe.recv() ++ ++ # multiprocessing.Pipe is not actually a pipe on at least Linux. that ++ # has an effect on the expected outcome of reading from it when the ++ # other end of the pipe dies, leading to possibly hanging on revc() ++ # below. So we must poll(). ++ def poll(): ++ try: ++ return self._pipe.poll(0.1) ++ except Exception: ++ # Poll might throw an exception even though there's still ++ # data to read. That happens when the underlying system call ++ # returns both POLLERR and POLLIN, but python doesn't tell us ++ # about it. So assume there is something to read, and we'll ++ # get an exception when trying to read the data. ++ return True ++ while poll(): ++ try: ++ start_time, end_time, io_diff, cpu_diff, cpu_percent, virt_mem, \ ++ swap_mem = self._pipe.recv() ++ except Exception: ++ # Let's assume we're done here ++ break + + # There should be nothing after the "done" message so + # terminate. + if start_time == 'done': +- done = True + break + + io = self._io_type(*io_diff) + virt = self._virt_type(*virt_mem) + swap = self._swap_type(*swap_mem) + cpu_times = [self._cpu_times_type(*v) for v in cpu_diff] + + self.measurements.append(SystemResourceUsage(start_time, end_time, + cpu_times, cpu_percent, io, virt, swap)) + + # We establish a timeout so we don't hang forever if the child + # process has crashed. + self._process.join(10) + if self._process.is_alive(): + self._process.terminate() + self._process.join(10) +- else: +- # We should have received a "done" message from the +- # child indicating it shut down properly. This only +- # happens if the child shuts down cleanly. +- assert done + + if len(self.measurements): + self.start_time = self.measurements[0].start + self.end_time = self.measurements[-1].end + + # Methods to record events alongside the monitored data. + + def record_event(self, name): + |