Commit cc06c227 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Revert "Fix the order of HSH_Fail() and ObjSetState()"

This reverts commit 501246e9.
parent f8ea5283
......@@ -809,6 +809,7 @@ vbf_stp_fail(struct worker *wrk, const struct busyobj *bo)
assert(bo->fetch_objcore->boc->state < BOS_FINISHED);
ObjSetState(wrk, bo->fetch_objcore, BOS_FAILED);
HSH_Fail(bo->fetch_objcore);
if (!(bo->fetch_objcore->flags & OC_F_BUSY))
HSH_Kill(bo->fetch_objcore);
return (F_STP_DONE);
......
......@@ -84,7 +84,6 @@
#include <stdlib.h>
#include "cache_varnishd.h"
#include "cache_objhead.h"
#include "cache_obj.h"
#include "vend.h"
#include "storage/storage.h"
......@@ -258,7 +257,8 @@ ObjWaitExtend(const struct worker *wrk, const struct objcore *oc, uint64_t l)
*/
void
ObjSetState(struct worker *wrk, struct objcore *oc, enum boc_state_e next)
ObjSetState(struct worker *wrk, const struct objcore *oc,
enum boc_state_e next)
{
const struct obj_methods *om;
......@@ -275,13 +275,6 @@ ObjSetState(struct worker *wrk, struct objcore *oc, enum boc_state_e next)
om->objsetstate(wrk, oc, next);
}
if (next == BOS_FAILED) {
/* Signal to cache_hash.c that this object is failed. This
* needs to happen before we signal the boc so that code
* will see the OC_F_FAILED flag after ObjWaitState() */
HSH_Fail(oc);
}
Lck_Lock(&oc->boc->mtx);
oc->boc->state = next;
AZ(pthread_cond_broadcast(&oc->boc->cond));
......
......@@ -293,7 +293,8 @@ int ObjGetSpace(struct worker *, struct objcore *, ssize_t *sz, uint8_t **ptr);
void ObjExtend(struct worker *, struct objcore *, ssize_t l);
uint64_t ObjWaitExtend(const struct worker *, const struct objcore *,
uint64_t l);
void ObjSetState(struct worker *, struct objcore *, enum boc_state_e next);
void ObjSetState(struct worker *, const struct objcore *,
enum boc_state_e next);
void ObjWaitState(const struct objcore *, enum boc_state_e want);
void ObjTrimStore(struct worker *, struct objcore *);
void ObjTouch(struct worker *, struct objcore *, vtim_real now);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment