Skip to content

Commit

Permalink
Work
Browse files Browse the repository at this point in the history
Signed-off-by: Cole Miller <cole.miller@canonical.com>
  • Loading branch information
cole-miller committed Oct 8, 2024
1 parent 61594cf commit a7a056b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/leader.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ void leader__close(struct leader *l)
tracef("leader close");
int rc;
/* TODO: there shouldn't be any ongoing exec request. */
if (l->exec != NULL) {
if (l->exec != NULL) {
fprintf(stderr, "[INFO FOR COLE] leader close %p\n", l->exec->stmt);

Check warning on line 191 in src/leader.c

View check run for this annotation

Codecov / codecov/patch

src/leader.c#L191

Added line #L191 was not covered by tests
assert(l->inflight == NULL);
l->exec->status = SQLITE_ERROR;
exec_done(l->exec, 0);

Check warning on line 194 in src/leader.c

View check run for this annotation

Codecov / codecov/patch

src/leader.c#L194

Added line #L194 was not covered by tests
Expand Down Expand Up @@ -458,6 +459,8 @@ static void exec_done(struct exec *req, int asyncness)
req->leader->exec = NULL;
if (req->cb != NULL && asyncness == 0) {
req->cb(req, status);
} else if (asyncness != 0) {
fprintf(stderr, "[INFO FOR COLE] skip callback for %p because asyncness is %d\n", req->stmt, asyncness);
}
}

Expand Down Expand Up @@ -540,9 +543,9 @@ static void exec_apply_cb(struct raft_apply *req,
static int exec_status(int r)
{
PRE(r != 0);

Check warning on line 545 in src/leader.c

View check run for this annotation

Codecov / codecov/patch

src/leader.c#L545

Added line #L545 was not covered by tests
return r == RAFT_LEADERSHIPLOST ? SQLITE_IOERR_LEADERSHIP_LOST :
r == RAFT_NOSPACE ? SQLITE_IOERR_WRITE :
r == RAFT_SHUTDOWN ? SQLITE_ABORT :
return r == RAFT_LEADERSHIPLOST ? SQLITE_IOERR_LEADERSHIP_LOST :
r == RAFT_NOSPACE ? SQLITE_IOERR_WRITE :
r == RAFT_SHUTDOWN ? SQLITE_ABORT :
SQLITE_IOERR;
}

Expand Down

0 comments on commit a7a056b

Please sign in to comment.