Skip to content

WIP / Hackathon: ODB over IPC #12

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

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7eca84e
odb--daemon: stub in new ODB over IPC daemon
jeffhostetler Apr 9, 2021
b8aec5f
odb--daemon: stub in --run --ipc-threads
jeffhostetler Apr 9, 2021
6a80920
odb-over-ipc: stub in client routines
jeffhostetler Apr 9, 2021
1ecf40c
odb--daemon: stub in --run framework
jeffhostetler Apr 9, 2021
8f8749e
odb--daemon: use async version of IPC
jeffhostetler Apr 12, 2021
680113b
odb-over-ipc: add --stop command
jeffhostetler Apr 12, 2021
08af616
odb-over-ipc: checkpoint. functional daemon side.
jeffhostetler Apr 12, 2021
e0be696
odb--daemon: handle get-oid response on client side
jeffhostetler Apr 12, 2021
49069e6
odb-over-ipc: fix for static analysis
jeffhostetler Apr 13, 2021
df65f89
odb-over-ipc: don't use oid_to_hex()
jeffhostetler Apr 13, 2021
b18ac40
ipc-unix-socket: refactor worker thread
jeffhostetler Apr 13, 2021
4c1e256
ipc-unix-socket: refactor worker_thread__wait_for_io_start
jeffhostetler Apr 13, 2021
98dd9a0
ipc-unix-socket: refactor worker_thread__do_io
jeffhostetler Apr 13, 2021
2bbe2a7
ipc-unix-socket: refactor SIMPLE_IPC_QUIT handling
jeffhostetler Apr 13, 2021
a3a203a
ipc-unix-socket: add keepalive support
jeffhostetler Apr 13, 2021
b13c45d
test-simple-ipc: add unit test for keepalive over simple ipc
jeffhostetler Apr 13, 2021
2fd2c66
ipc-win32: add keepalive support
jeffhostetler Apr 13, 2021
58461d3
t0052: add keepalive unit test
jeffhostetler Apr 14, 2021
092c418
odb-over-ipc: make use of keepalive-style connection
jeffhostetler Apr 14, 2021
47e9683
odb--daemon: add trace2 regions around object fetching
jeffhostetler Apr 14, 2021
59f4490
odb-over-ipc: only send object content if requested
jeffhostetler Apr 15, 2021
e7c187e
simple-ipc: preparations for supporting binary messages.
jeffhostetler Apr 16, 2021
149a5ab
odb-over-ipc: convert request to binary
jeffhostetler Apr 16, 2021
b16b5fc
odb-over-ipc: add binary response to get-oid
jeffhostetler Apr 16, 2021
90a4379
simple-ipc: fix Windows version for binary requests
jeffhostetler Apr 16, 2021
2727739
odb-over-ipc: set initial size of receive buffer to avoid reallocs
jeffhostetler Apr 16, 2021
f90cecb
odb--daemon: add oidmap cache
jeffhostetler Apr 16, 2021
41da028
fixup cast in oidmap code
jeffhostetler Apr 16, 2021
e5ea314
odb-over-ipc: add core.useOdbOverIpc config setting
jeffhostetler Apr 18, 2021
c67771c
odb--daemon: only fetch content from disk if/when requested
jeffhostetler Apr 19, 2021
3d0def3
p7100: add perf test for odb--daemon
jeffhostetler Apr 19, 2021
a0f0ae3
odb--daemon: disable resize on oidmap
jeffhostetler Apr 19, 2021
d69e140
odb-over-ipc: fix coccinelle suggested change
jeffhostetler Apr 20, 2021
eb1d228
hackathon: add results to summarize my week of hacking
jeffhostetler Apr 20, 2021
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
/git-mv
/git-name-rev
/git-notes
/git-odb--daemon
/git-p4
/git-pack-redundant
/git-pack-objects
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ LIB_OBJS += notes.o
LIB_OBJS += object-file.o
LIB_OBJS += object-name.o
LIB_OBJS += object.o
LIB_OBJS += odb-over-ipc.o
LIB_OBJS += oid-array.o
LIB_OBJS += oidmap.o
LIB_OBJS += oidset.o
Expand Down Expand Up @@ -1119,6 +1120,7 @@ BUILTIN_OBJS += builtin/multi-pack-index.o
BUILTIN_OBJS += builtin/mv.o
BUILTIN_OBJS += builtin/name-rev.o
BUILTIN_OBJS += builtin/notes.o
BUILTIN_OBJS += builtin/odb--daemon.o
BUILTIN_OBJS += builtin/pack-objects.o
BUILTIN_OBJS += builtin/pack-redundant.o
BUILTIN_OBJS += builtin/pack-refs.o
Expand Down
1 change: 1 addition & 0 deletions builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ int cmd_multi_pack_index(int argc, const char **argv, const char *prefix);
int cmd_mv(int argc, const char **argv, const char *prefix);
int cmd_name_rev(int argc, const char **argv, const char *prefix);
int cmd_notes(int argc, const char **argv, const char *prefix);
int cmd_odb__daemon(int argc, const char **argv, const char *prefix);
int cmd_pack_objects(int argc, const char **argv, const char *prefix);
int cmd_pack_redundant(int argc, const char **argv, const char *prefix);
int cmd_patch_id(int argc, const char **argv, const char *prefix);
Expand Down
16 changes: 15 additions & 1 deletion builtin/fsmonitor--daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,10 +996,24 @@ static int do_handle_client(struct fsmonitor_daemon_state *state,

static ipc_server_application_cb handle_client;

static int handle_client(void *data, const char *command,
static int handle_client(void *data,
const char *command, size_t command_len,
ipc_server_reply_cb *reply,
struct ipc_server_reply_data *reply_data)
{
// TODO I did not take time to ensure that `command_len` is
// TODO large enough to do all of the strcmp() and starts_with()
// TODO calculations when I converted the IPC API to take
// TODO `command, command_len` rather than just `command`.
// TODO So some cleanup is needed here.
// TODO
// TODO But we know that FSMonitor always uses regular text
// TODO in both the request and response (no binary messages
// TODO here), so the cleanup is more of the `assert` form.
// TODO
// TODO For example, I should pass `command, command_len` into
// TODO `do_handle_client()` for completeness.

struct fsmonitor_daemon_state *state = data;
int result;

Expand Down
Loading