Skip to content

Commit f8217f7

Browse files
committed
cachedb_perf: orphan a timed-out pull that takes the forced leg
The slot-release condition still keyed on held_node, so a first leg that timed out with a held answer in hand released its slot instead of lingering as an orphan - dropping an authoritative answer that limped in late, contrary to the comment beside it. Release only on a held-COMPLETE exchange; a timeout-with-held orphans as documented and the forced leg runs off the held_node copy. Also silences the set-but-unused warning the clean build caught.
1 parent 86afdbe commit f8217f7

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎modules/cachedb_perf/cachedb_perf.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3036,9 +3036,12 @@ static int pcache_pull_finish_ex(pcache_col_t *col, const str *key,
30363036
* stored below; an oversize holder and a settled absence are final
30373037
* answers - none of those wants a late reply. */
30383038
if (rc == 1 || sl->oversize || sl->negative >= sl->expect ||
3039-
held_node > 0) {
3040-
/* held-only is concluded too: the holders withheld deliberately,
3041-
* so no late value is coming to an orphan */
3039+
held_complete) {
3040+
/* a held-COMPLETE exchange is concluded too: every peer spoke and
3041+
* the holders withheld deliberately, so no late value is coming to
3042+
* an orphan. A timeout-with-held is NOT concluded - the silent
3043+
* peer may still answer - so that one orphans as usual below, and
3044+
* the forced leg runs off the held_node copy taken above. */
30423045
sl->id = 0; /* the slot is reusable from here */
30433046
} else {
30443047
sl->orphan = 1;

0 commit comments

Comments
 (0)