Skip to content

Commit 7c83a7d

Browse files
JosiahWIcmcfarlen
authored andcommitted
Reset write lock state to init after closing write (#12215)
This commit mitigates the crash reported in #11700. That crash happens when a redirect is issued on a state machine that has already cached a response and closed the cache write VC. After this patch, the state machine will likely open a new cache VC to cache the response from the origin it was redirected to. We will refer to the original origin as A, and the origin the state machine was redirected to after the response from A as B. We have not yet reproduced this locally - the exact sequence of events that gets the state machine into this state are still unknown. (cherry picked from commit 5c0aaf2)
1 parent 6de6ebb commit 7c83a7d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/proxy/http/HttpSM.cc

+2
Original file line numberDiff line numberDiff line change
@@ -6460,6 +6460,7 @@ HttpSM::perform_cache_write_action()
64606460
// Write close deletes the old alternate
64616461
cache_sm.close_write();
64626462
cache_sm.close_read();
6463+
t_state.cache_info.write_lock_state = HttpTransact::CACHE_WL_INIT;
64636464
break;
64646465
}
64656466

@@ -6518,6 +6519,7 @@ HttpSM::issue_cache_update()
65186519
}
65196520
// Now close the write which commits the update
65206521
cache_sm.close_write();
6522+
t_state.cache_info.write_lock_state = HttpTransact::CACHE_WL_INIT;
65216523
}
65226524

65236525
int

0 commit comments

Comments
 (0)