Skip to content

Fix valgrind tests. #1037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ matrix:
- export PATH="$HOME/miniconda/bin:$PATH"
- ./.travis/install-ray.sh

script:
- cd python/ray/core
- bash ../../../src/common/test/run_valgrind.sh
- bash ../../../src/plasma/test/run_valgrind.sh
- bash ../../../src/local_scheduler/test/run_valgrind.sh
- cd ../../..

script:
- python ./python/ray/plasma/test/test.py valgrind
- python ./python/ray/local_scheduler/test/test.py valgrind
- python ./python/ray/global_scheduler/test/test.py valgrind
Expand Down
12 changes: 8 additions & 4 deletions src/common/state/redis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1378,11 +1378,15 @@ void redis_local_scheduler_table_send_info(TableCallbackData *callback_data) {

void redis_local_scheduler_table_disconnect(DBHandle *db) {
flatbuffers::FlatBufferBuilder fbb;
LocalSchedulerInfoMessageBuilder builder(fbb);
builder.add_db_client_id(to_flatbuf(fbb, db->client));
builder.add_is_dead(true);
auto message = builder.Finish();
/* Create the flatbuffers message. */
double empty_array[] = {};
/* Most of the flatbuffer message fields don't matter here. Only the
* db_client_id and the is_dead field matter. */
auto message = CreateLocalSchedulerInfoMessage(
fbb, to_flatbuf(fbb, db->client), 0, 0, 0,
fbb.CreateVector(empty_array, 0), fbb.CreateVector(empty_array, 0), true);
fbb.Finish(message);

redisReply *reply = (redisReply *) redisCommand(
db->sync_context, "PUBLISH local_schedulers %b", fbb.GetBufferPointer(),
fbb.GetSize());
Expand Down
2 changes: 2 additions & 0 deletions src/common/test/run_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# This needs to be run in the build tree, which is normally ray/build

set -x

# Cause the script to exit if a single command fails.
set -e

Expand Down
2 changes: 2 additions & 0 deletions src/local_scheduler/test/run_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# This needs to be run in the build tree, which is normally ray/build

set -x

# Cause the script to exit if a single command fails.
set -e

Expand Down
9 changes: 5 additions & 4 deletions src/plasma/plasma_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ void PlasmaManagerState_free(PlasmaManagerState *state) {

ARROW_CHECK_OK(state->plasma_conn->Disconnect());
delete state->plasma_conn;
destroy_outstanding_callbacks(state->loop);
event_loop_destroy(state->loop);
delete state;
}
Expand Down Expand Up @@ -671,7 +672,7 @@ void send_queued_request(event_loop *loop,
conn->pending_object_transfers.erase(buf->object_id);
}
conn->transfer_queue.pop_front();
free(buf);
delete buf;
}
}

Expand Down Expand Up @@ -727,7 +728,7 @@ void process_data_chunk(event_loop *loop,
conn->manager_state->plasma_conn->Release(buf->object_id.to_plasma_id()));
/* Remove the request buffer used for reading this object's data. */
conn->transfer_queue.pop_front();
free(buf);
delete buf;
/* Switch to listening for requests from this socket, instead of reading
* object data. */
event_loop_remove_file(loop, data_sock);
Expand All @@ -749,7 +750,7 @@ void ignore_data_chunk(event_loop *loop,
}

free(buf->data);
free(buf);
delete buf;
/* Switch to listening for requests from this socket, instead of reading
* object data. */
event_loop_remove_file(loop, data_sock);
Expand Down Expand Up @@ -1444,7 +1445,7 @@ void ClientConnection_free(ClientConnection *client_conn) {
/* Close the manager connection and free the remaining state. */
close(client_conn->fd);
free(client_conn->ip_addr_port);
free(client_conn);
delete client_conn;
}

void handle_new_client(event_loop *loop,
Expand Down
2 changes: 2 additions & 0 deletions src/plasma/test/run_valgrind.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -x

# Cause the script to exit if a single command fails.
set -e

Expand Down