| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
A previous fix to make close() occur later can cause socket reuse by servers to fail as previous sockets are left asynchronously open.
This change:
- adds a callback to TCP server shutdown to signal that the server is completely shutdown
- wait for that callback before destroying listeners in the server (and before destroying the server)
- handles fallout
|
|
|
|
|
| |
This is potentially unsafe since checking the deadline involves more than 1 word
read.
|
|
|
|
|
| |
attempting
the trylock. This shaves the number of g_mu and g_checker_mu uses dramatically in perf test workload and all tests still pass.
|
|
|
|
|
|
| |
-) Introduce a wait-loop with a 100ms delay on iomgr shutdown, so that background threads have the chance to place last minute callbacks without having to stall for the whole 10 seconds deadline.
-) io completion ports will get notifications on socket shutdowns, so we need to delay their deletions for after we get a notification for them.
-) we need to keep some sense of how many orphan sockets are in, so we can properly collect them - let's not shutdown the iocp loop until after all orphans have been collected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-) using dupenv_s instead of getenv_s and calling strdup ourselves.
-) few impossible-to-obtain if checks.
-) various signed/unsigned casting.
-) using time_t instead of time32_t
-) checking output of FormatMessage for failures.
-) don't redefine _WIN32_WINNT without undefining it first.
-) fixed msvc's interlocked casting.
-) renamed AddPort to AddListeningPort.
-) added protobuf's third_party includes to search path.
-) added a missing definition for inet_ntop in mingw32.
-) removed useless declarations.
|
|
|
|
|
| |
Use this to relax the acq_loads in some fd_posix assertions. The primary
goal here is to avoid masking potential iomgr races from tsan.
|
|
|
|
|
|
|
|
| |
Change all !str[n]cmp to be str[n]cmp == 0 consistently across the codebase.
Issue #231
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
|
| |
|
| |
|
|\
| |
| | |
Remove some debugging logs from the unary poll promote path
|
| |
| |
| |
| | |
I put these in while debugging correctness, and forgot to remove them.
|
|/
|
|
|
|
|
|
| |
First: ugh.
Second: allow tracer global variables to be registered and then parsed out of a configuration environment variable.
Expose TSI trace config variable directly to ease this a little.
|
| |
|
|\
| |
| | |
Ensure there is no concurrent poller for unary->multipoll
|
| |
| |
| |
| |
| |
| | |
Instead, we do a shutdown() at the point we are currently closing, to
kick off socket teardown while ensuring an fd ref is sufficient to make
concurrent syscalls like epoll_ctl safe.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This allows us to safely asynchronously add FDs in the
possibly-promoting unary add case.
Also fix the unary add async path to properly handle more of the extra
cases it needs to handle.
|
| |\
| |/
|/| |
|
| | |
|
|\ \ |
|
| | | |
|
| | | |
|
|/ / |
|
| |
| |
| |
| | |
This will help greatly when it comes to diagnosing customer issues.
|
|\ \
| | |
| | | |
Fix TSAN reported error in fd_posix.c
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The race here is:
Initially unary poller has one FD, FD_1
Thread 1 adds FD_2, promoting to multipoll, entailing epoll_ctl on FD_1
and FD_2.
Concurrently, Thread 2 returns from unary poll and executes one of
FD_1's callbacks, which ultimately leads to a close(FD_1) which races
with the epoll_ctl by thread 1.
The solution is to ensure that we don't concurrently poll and promote,
which requires a bit of extra care.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We now pass down pointers to closures instead of (callback, arg) pair
elements separately. This allows us to store one word atomically, fixing
a race condition.
All call sites have been updated to the new API. No new allocations are
incurred. grpc_fd_state is deleted to avoid any temptation to ever add
anything there again.
|
|/
|
|
| |
in epoll wait.
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
Remove existing UDS listeners IFF they are a socket before trying to create a new socket.
|
| |
| |
| |
| |
| | |
This prevents a bug whereby not all fds were destroyed at application
exit.
|
| | |
|
|\| |
|
| | |
|
|\|
| |
| |
| |
| | |
Conflicts:
Makefile
|
|\ \ |
|
| | |\
| | |/
| |/| |
|
| | | |
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| | |
-) Let's not use _POSIX_SOURCE. It usually implies too much C99. _BSD_SOURCE would be the right thing to do here.
-) _BSD_SOURCE is getting deprecated by glibc, so we also have to define _DEFAULT_SOURCE under Linux.
-) accept4 and eventfd arn't as old as we may think; let's detect for it.
-) stdint.h interferes with all these definitions if included too early; let's move it down.
|
|/
|
|
|
|
| |
Allow binding a different completion queue to each registered method.
This will allow multiplexing for the C++ server between sync & async
methods more easily.
|
| |
|
| |
|
|
|
|
|
|
|
| |
1. Close the epoll_fd at destroy
2. Finish the comment about signal/broadcast on the cv
3. Rename GPR_POSIX_MULTIPOLL_WITH_EPOLL to
GPR_LINUX_MULTIPOLL_WITH_EPOLL
|
| |
|
|\ |
|