Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/buildbot_8_4p1/buildbot/db/pool.py

Issue 2108553002: Revert buildbot 361b81b43fc7793b66facd4bac7abe0adb30f3d5. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/buildbot_8_4p1/buildbot/db/pool.py
diff --git a/third_party/buildbot_8_4p1/buildbot/db/pool.py b/third_party/buildbot_8_4p1/buildbot/db/pool.py
index 3e0f7b935e07ae69c75240c04c2277776f58294c..ff5e67eea7bd89802dc7db9b0b7e1585d39771b8 100644
--- a/third_party/buildbot_8_4p1/buildbot/db/pool.py
+++ b/third_party/buildbot_8_4p1/buildbot/db/pool.py
@@ -16,28 +16,9 @@
import os
import sqlalchemy as sa
import twisted
-from twisted.internet import reactor, threads, defer, task
+from twisted.internet import reactor, threads, defer
from twisted.python import threadpool, failure, versions, log
-# Hack for bug #1992. In as-yet-unknown circumstances, select() fails to
-# notice that a selfpipe has been written to, thus causing callFromThread, as
-# used in deferToThreadPool, to hang indefinitely. The workaround is to wake
-# up the select loop every second by ensuring that there is an event occuring
-# every second, with this busy loop:
-def bug1992hack(f):
- def w(*args, **kwargs):
- busyloop = task.LoopingCall(lambda : None)
- busyloop.start(1)
- d = f(*args, **kwargs)
- def stop_loop(r):
- busyloop.stop()
- return r
- d.addBoth(stop_loop)
- return d
- w.__name__ = f.__name__
- w.__doc__ = f.__doc__
- return w
-
class DBThreadPool(threadpool.ThreadPool):
"""
@@ -96,7 +77,6 @@ class DBThreadPool(threadpool.ThreadPool):
reactor.removeSystemEventTrigger(self._stop_evt)
self._stop()
- @bug1992hack
def do(self, callable, *args, **kwargs):
"""
Call C{callable} in a thread, with a Connection as first argument.
@@ -117,7 +97,6 @@ class DBThreadPool(threadpool.ThreadPool):
return rv
return threads.deferToThreadPool(reactor, self, thd)
- @bug1992hack
def do_with_engine(self, callable, *args, **kwargs):
"""
Like L{do}, but with an SQLAlchemy Engine as the first argument. This
@@ -138,7 +117,6 @@ class DBThreadPool(threadpool.ThreadPool):
# of the synchronization wrong - the thread may still be "in use" when the
# deferred fires in the parent, which can lead to database accesses hopping
# between threads. In practice, this should not cause any difficulty.
- @bug1992hack
def do_081(self, callable, *args, **kwargs): # pragma: no cover
d = defer.Deferred()
def thd():
@@ -158,7 +136,6 @@ class DBThreadPool(threadpool.ThreadPool):
self.callInThread(thd)
return d
- @bug1992hack
def do_with_engine_081(self, callable, *args, **kwargs): # pragma: no cover
d = defer.Deferred()
def thd():
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698