pike.git/
lib/
modules/
Sql.pmod/
pgsql_util.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2018-05-07
2018-05-07 21:13:14 by Stephen R. van den Berg <srb@cuci.nl>
c9ad7bba1e7afaf9ce4970a200ee737f176734a2 (
29
lines) (+
19
/-
10
)
[
Show
|
Annotate
]
Branch:
8.0
pgsql: Eliminate rare deadlock on heavy interleaved queries.
384:
final bufcon|conxsess start(void|int waitforreal) { Thread.MutexKey lock;
+
#ifdef PG_DEBUGRACE
+
if (nostash->current_locking_thread())
+
PD("Nostash locked by %s\n",
+
describe_backtrace(nostash->current_locking_thread()->backtrace()));
+
#endif
if (lock = (waitforreal ? nostash->lock : nostash->trylock)(1)) { int mode; #ifdef PG_DEBUGRACE
1304:
void|bufcon|conxsess plugbuffer = CHAIN(cs); int retval = KEEP; PD("%O Try Closeportal %d\n", _portalname, _state);
-
Thread.MutexKey lock = closemux->lock();
+
Thread.MutexKey lock = closemux->lock(
2
);
// When called from _sendexecute(), it is already locked
_fetchlimit = 0; // disables further Executes switch (_state) { case PARSING:
1348:
private void replenishrows() { if (_fetchlimit && sizeof(datarows) <= _fetchlimit >> 1) {
+
Thread.MutexKey lock = closemux->lock();
+
if (_fetchlimit) {
_fetchlimit = pgsqlsess._fetchlimit; if (bytesreceived) _fetchlimit = min((portalbuffersize >> 1) * index / bytesreceived || 1, _fetchlimit);
-
Thread.MutexKey
lock
=
closemux->lock
()
;
-
if
(_fetchlimit
&&
inflight <= (_fetchlimit - 1) >> 1)
+
if
(
_fetchlimit
)
+
if (inflight <= (_fetchlimit - 1) >> 1)
_sendexecute(_fetchlimit);
-
else
if
(!_fetchlimit)
+
else
PD("<%O _fetchlimit %d, inflight %d, skip execute\n", _portalname, _fetchlimit, inflight); } }
-
+
}
final void _processdataready(array datarow, void|int msglen) { bytesreceived += msglen;