r4957 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Wed Jun 16 10:44:00 CEST 2010


Author: phk
Date: 2010-06-16 10:44:00 +0200 (Wed, 16 Jun 2010)
New Revision: 4957

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_shmem.c
Log:
Add a comment about desirable but complex error recovery



Modified: trunk/varnish-cache/bin/varnishd/mgt_shmem.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_shmem.c	2010-06-14 09:35:30 UTC (rev 4956)
+++ trunk/varnish-cache/bin/varnishd/mgt_shmem.c	2010-06-16 08:44:00 UTC (rev 4957)
@@ -25,6 +25,63 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
+ *
+ *
+ * TODO:
+ *
+ * There is a risk that the child process might corrupt the VSM segment
+ * and we should capture that event and recover gracefully.
+ *
+ * A possible state diagram could be:
+ *
+ *	[manager start]
+ *		|
+ *		v
+ *      Open old VSM,
+ *	check pid 	--------> exit/fail (-n message)
+ *		|
+ *		+<----------------------+
+ *		|			^
+ *		v			|
+ *	Create new VSM			|
+ *		|			|
+ *		v			|
+ *	Init header			|
+ *	Alloc VSL			|
+ *	Alloc VSC:Main			|
+ *	Alloc Args etc.			|
+ *		|			|
+ *		+<--------------+	|
+ *		|		^	|
+ *		v		|	|
+ *	start worker		|	|
+ *		|		|	|
+ *		|		|	+<---- worker crash
+ *		v		|	^
+ *	Reset VSL ptr.		|	|
+ *	Reset VSC counters	|	|
+ *		|		|	|
+ *		+<------+	|	|
+ *		|	^	|	|
+ *		v	|	|	|
+ *	alloc dynamics	|	|	|
+ *	free dynamics	|	|	|
+ *		|	|	|	|
+ *		v	|	|	|
+ *		+------>+	|	|
+ *		|		|	|
+ *		v		|	|
+ *	stop worker		|	|
+ *		|		|	|
+ *		v		|	|
+ *	Check consist---------- | ----->+
+ *		|		|
+ *		v		|
+ *	Free dynamics		|
+ *		|		|
+ *		v		|
+ *		+-------------->+
+ *		
  */
 
 #include "config.h"




More information about the varnish-commit mailing list