Skip to content

Commit

Permalink
Revert "Don't test the engine on startup"
Browse files Browse the repository at this point in the history
This reverts commit ca0dae9.

This is needed because we load the engine to get function pointers for
get_item_info and item_set_cas, then destroy it, which can segfault if
we haven't initialized the engine.

The worst problem is that we create a db in /tmp; we can avoid this by
not loading a database if no dbname is given.

Change-Id: I45deb3dcfa37056e8fd639ef0aaab5b302c91ca0
Reviewed-on: http://review.northscale.com:8080/408
Tested-by: Dustin Sallings <dustin@spy.net>
Reviewed-by: Dustin Sallings <dustin@spy.net>
  • Loading branch information
Sean Lynch authored and dustin committed Jun 12, 2010
1 parent afa72b1 commit 71dd3df
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bucket_engine.c
Expand Up @@ -341,7 +341,16 @@ static ENGINE_HANDLE *load_engine(const char *soname, const char *config_str,
return NULL;
}

if (engine->interface != 1) {
if (engine->interface == 1) {
ENGINE_HANDLE_V1 *v1 = (ENGINE_HANDLE_V1*)engine;
if (v1->initialize(engine, config_str) != ENGINE_SUCCESS) {
v1->destroy(engine);
fprintf(stderr, "Failed to initialize instance. Error code: %d\n",
error);
dlclose(handle);
return NULL;
}
} else {
fprintf(stderr, "Unsupported interface level\n");
dlclose(handle);
return NULL;
Expand Down

0 comments on commit 71dd3df

Please sign in to comment.