aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/server/GrpcServerImpl.java
Commit message (Collapse)AuthorAge
...
* Move the verification of the JVM earlier in the client so that less time ↵Gravatar Lukacs Berki2016-07-08
| | | | | | | | | | | passes between the Ping() and Run() calls and make Ping() and Cancel() calls restart the server timeout interval. This "fixes" a race condition where the client would call Ping(), the server would time out and then the Run() call would fail. Of course, this is not an principled fix because in theory, the timeout can still happen between the two calls, but now there are only simple file system operations and a tiny bit of CPU use between the two so it should be vanishingly unlikely. We use ->Ping() to verify server liveness after we start it up, so in theory, the timeout could strike between those two calls, too... TESTED=By running "bazel --max_timeout_secs=2 info install_base" 100 times in a test and running the test 200 times. This procedure triggered the bug pretty reliably. -- MOS_MIGRATED_REVID=126902519
* Make the timeout thread shut the server down in an orderly way.Gravatar Lukacs Berki2016-07-07
| | | | | -- MOS_MIGRATED_REVID=126685659
* Figure out the actual address of the command port a little differently, in a ↵Gravatar Lukacs Berki2016-04-28
| | | | | | | way that actually works. -- MOS_MIGRATED_REVID=120997894
* Fix a race condition introduced in unknown commit (that is, the January of ↵Gravatar Lukacs Berki2016-04-26
| | | | | | | | | | | | | 2009!). If a "blaze clean --expunge" was run concurrently with another command (that was waiting for the lock), it's possible that the clean command deletes the lock file, the new server starts up, then the JVM shutdown hooks delete the PID files from the *new* server. There is still a slight possibility of a race condition if the lock is deleted then IOException occurs which prevents the BlazeShutdownException from being raised, but I'd rather not introduce another channel from command implementations to RPCServer to close that loophole. This issue was triggered by commit 5a78166ee4edbd295f5d5fdb94785025285e764b, after which the PID files for the new server are written a bit more early, thus increasing the time window in which the race condition can happen. -- MOS_MIGRATED_REVID=120805163
* Make gRPC mode honor --max_idle_secs.Gravatar Lukacs Berki2016-04-25
| | | | | -- MOS_MIGRATED_REVID=120699557
* Make the server tell not only the port, but also the address it is listening on.Gravatar Lukacs Berki2016-04-25
| | | | | | | This is necessary because on Windows/msys2, the Java gRPC server listens only on IPv6 but the C++ client only tries to connect over IPv4, resulting in breakage. -- MOS_MIGRATED_REVID=120689437
* Make the integration tests pass with gRPC client/server comms.Gravatar Lukacs Berki2016-04-21
| | | | | | | | | | | In particular: - Make a SIGINT to the server interrupt every command - Parse negative numbers on the command line correctly (std::stoi throws an exception, and I'd rather not start using C++ exceptions) - Use "bytes" for command line arguments instead of "string" in the client/server proto . This is more principled, although we pretend all arguments are strings all over the place and it works for "blaze run" mostly by accident. -- MOS_MIGRATED_REVID=120434432
* Assorted changes wrt. gRPC client/server comms:Gravatar Lukacs Berki2016-04-21
| | | | | | | | | - Actually make it work again (commit 00cfb7df61b1f3d9fac8ee29d92b315cbfe6d28f broke it, maybe I shouldn't send out changes in a hurry next time) - Rename --grpc_port to --command_port (it's a bit better name) - Do not send a kill signal to the server that can't be connected if we only connect to it to verify its presence -- MOS_MIGRATED_REVID=120418784
* Block when another command is running on the server and not on the client ↵Gravatar Lukacs Berki2016-04-20
| | | | | | | when in gRPC mode. -- MOS_MIGRATED_REVID=120233121
* Bind the gRPC command server port only to localhost.Gravatar Lukacs Berki2016-04-19
| | | | | | | Work towards #930. -- MOS_MIGRATED_REVID=120205147
* Make it possible to interrupt commands when communicating over gRPC.Gravatar Lukacs Berki2016-04-19
| | | | | | | | | | | Drive-by fix: eliminate the GRPC messages from the console by passing a null logging function. This also prepares us for the time when multiple commands will be running, because then we'll need to tell which command exactly we want to interrupt. Work towards #930. -- MOS_MIGRATED_REVID=120203008
* Do not start the AF_UNIX server when in gRPC mode.Gravatar Lukacs Berki2016-04-19
| | | | | | | Work towards #930. With this, it's conceivable that server mode works on Windows to some degree (I haven't tried, though, because there are many issues that need to be fixed) -- MOS_MIGRATED_REVID=120202037
* Rename field names in command_server.proto so that they don't conflict with ↵Gravatar Lukacs Berki2016-04-18
| | | | | | | | | C symbols. Fixed #1155. -- MOS_MIGRATED_REVID=120107746
* Initial version of client-server communication over gRPC. Gravatar Lukacs Berki2016-04-15
| | | | | | | | | | | | | | | | This still has a number of issues, including, but not limited to: - When switching between gRPC and AF_UNIX mode, you need to do a manual shutdown - The console is spammed with "connection refused" messages on server startup - When in gRPC mode, server also starts up an AF_UNIX server even though it's not necessary and concurrent requests probably make Bazel crash and burn - I have no idea how concurrent gRPC requests are handled and now many threads gRPC creates - Not tested except under Linux - The request/response cookies are written in an odd format (negative bytes are not handled correctly). This is only a cosmetic issue, since the data content of the string is the same either way. Can be tested with the --grpc_port=0 (or a valid port number) startup option. -- MOS_MIGRATED_REVID=119948959
* Add the --grpc_port startup option and start a Java server if it's passed in.Gravatar Lukacs Berki2016-04-14
Note that the presence of server/grpc_port does not guarantee that the server actually listens to it and we can't guarantee it, either, because it can always be kill -9'd. I haven't decided yet how the transition between AF_UNIX and gRPC will work. For now, I'm happy that we can start up a Java server. The way to get the kernel-chosen port is truly awful, but it is apparently impossible to do so in a different way: https://github.com/grpc/grpc-java/issues/72 -- MOS_MIGRATED_REVID=119828354