Commit Graph

190 Commits

Author SHA1 Message Date
Young Liu 8cc3e4d3c6 Merge release-6.3 into master 2020-10-19 22:51:56 -07:00
sfc-gh-tclinkenbeard a9607bdcec Explicitly seal classes that inherit but aren't inherited from 2020-10-07 21:58:24 -07:00
sfc-gh-tclinkenbeard 8571dcfe28 Use override where applicable in fdbserver 2020-10-07 18:41:19 -07:00
Evan Tschannen 2c5a2909cd fixed compiler error 2020-10-06 09:44:16 -07:00
Evan Tschannen 59d4e8b629 added a timeout to TLS handshakes 2020-10-05 15:24:03 -07:00
sfc-gh-tclinkenbeard 0ac08f6a9b Replace NULL with nullptr in flow 2020-09-20 11:31:49 -07:00
Evan Tschannen a49cb41de7 Merge branch 'release-6.3'
# Conflicts:
#	CMakeLists.txt
#	cmake/ConfigureCompiler.cmake
#	fdbserver/Knobs.cpp
#	fdbserver/StorageCache.actor.cpp
#	fdbserver/storageserver.actor.cpp
#	flow/ThreadHelper.actor.h
#	flow/serialize.h
#	tests/CMakeLists.txt
2020-07-29 00:31:55 -07:00
Steve Atherton c4f3553826 TLS handshake limit changed to regular flow lock, added new knob for simultaneous handshakes limit and removed old knobs. Added knob to control how much data the FlowTransport connectionWriter() can write using multiple write() calls before yielding to other tasks, and updated p2p network test to use the same logic. Changed knob defaults for send limit on single writes and TLS handshake thread count. 2020-07-16 02:31:17 -07:00
Steve Atherton 5151f1167c Added TLS option to limit the number of glibc malloc arenas if TLS background threads are created. TLS initialization now has three phases in order to avoid creating TLS threads or limit the malloc arena count unnecessarily. 2020-06-28 17:29:13 -07:00
Steve Atherton 813dbfb297 TLS handshake threads are now created with TLS initialization instead of when the network is created since they may not be needed and it avoids calling startThread() with a custom stack size too early in process execution. StartThread() now logs a warning if the given stack size can't be used. Reorganized TLS handshake thread state near the other TLS related stuff. 2020-06-23 03:09:56 -07:00
Steve Atherton c3ce0034bf Background threads for TLS handshakes use a stack size based on a knob. Platform::startThread() now accepts a stack size. The generic thread pool implementation takes an optional stack size override which is used for each added thread. 2020-06-23 02:08:01 -07:00
Steve Atherton 5b19233989 Implemented count of used background TLS handshake threads differently using a generic utility class that updates the count on destruction. 2020-06-23 00:45:07 -07:00
Steve Atherton a48d005f61 Bug fixes, stats improvements. 2020-06-22 13:37:13 -07:00
Steve Atherton d75b4c9a69 Bug fix, accidental local variable redeclaration. 2020-06-22 05:53:37 -07:00
Steve Atherton d681e9d350 Follow TLS_DISABLED macro setting. 2020-06-21 11:21:24 -07:00
Steve Atherton 6330f8b458 TLS handshakes can now be done using up to a configured number of background threads if any of them are not busy. 2020-06-21 06:23:32 -07:00
sfc-gh-tclinkenbeard d7cb54d2b2 Fixed Windows CMake build 2020-06-20 23:03:18 -07:00
sfc-gh-tclinkenbeard a59925dd73 Added more const-correctness improvements 2020-06-20 22:15:19 -07:00
sfc-gh-tclinkenbeard 99bf993815 Replace BOOST_NOEXCEPT with noexcept 2020-06-09 22:39:19 -07:00
Evan Tschannen 30bfd606c0 Merge branch 'release-6.2' into release-6.3
# Conflicts:
#	CMakeLists.txt
#	documentation/sphinx/source/downloads.rst
#	documentation/sphinx/source/release-notes.rst
#	fdbserver/worker.actor.cpp
#	packaging/msi/FDBInstaller.wxs
#	versions.target
2020-06-04 19:21:32 -07:00
Steve Atherton bf072d68ec Workarounds for strange behaviors in Boost ssl sockets on MacOS and Linux. When writing to the ssl socket, write_some() would sometimes return BrokenPipe instead of WouldBlock unless onWriteable on the raw socket was checked first. On MacOS, even with the onWriteable check using a send size greater than 2016 (determined experimentally) would still result in the error. Also consolidated two identical copies of SendBufferIterator. 2020-06-04 01:44:05 -07:00
A.J. Beamon 86f712657e Eliminate the undefined behavior of calling run_network twice, instead returning an error. 2020-05-22 13:31:06 -07:00
Kao Makino c2e80fe47b Linux aarch64 port 2020-05-09 22:14:03 +00:00
Dave Cottlehuber 95bc24de11 flow: update headers and includes 2020-04-30 18:11:23 +00:00
Evan Tschannen c87aa33941 Merge branch 'release-6.2'
# Conflicts:
#	CMakeLists.txt
#	bindings/go/src/fdb/generated.go
#	documentation/sphinx/source/api-common.rst.inc
#	documentation/sphinx/source/api-ruby.rst
#	documentation/sphinx/source/release-notes.rst
#	fdbclient/FailureMonitorClient.actor.cpp
#	fdbclient/NativeAPI.actor.cpp
#	fdbclient/vexillographer/fdb.options
#	fdbrpc/FlowTransport.actor.cpp
#	fdbserver/OldTLogServer_6_0.actor.cpp
#	fdbserver/TLogServer.actor.cpp
#	fdbserver/fdbserver.actor.cpp
#	versions.target
2020-04-23 13:47:53 -07:00
Alex Miller c6df20a179
Use nullptr instead of NULL 2020-04-21 20:39:45 -07:00
Alex Miller a51746b307 Match 6.2.15's behavior in how invalid/unreadable/non-existent certs are handled.
Which is to proceed past Net2 creation, and allow certificate refresh to
try and eventually load valid certs.  Additionally, fix certificate
refeshing dieing if the certificate is not readable when first called.

In testing, I also found and fixed an issue where if a cert went from
unreadable to readable, we wouldn't reload the TLS context, due to not
considering it as a file change.
2020-04-20 21:38:04 -07:00
Alex Miller 20fe068863 Merge branch 'tls-background-eio-thread' into tls-permission-errors 2020-04-20 20:51:05 -07:00
Xin Dong 49c6bb90ef
Merge pull request #2982 from alexmiller-apple/tls-log-settings
Log Net2TLSConfig with paths and settings when using TLS.
2020-04-20 15:46:26 -07:00
Alex Miller 75a4f3b7c9 Remove comment about ignoring runOnMainThread errors.
If we got an exception, it wouldn't be of type `Error` anyway, so
it seems like things would crash regardless.
2020-04-20 13:19:42 -07:00
Alex Miller da8e47ea25 Merge remote-tracking branch 'upstream/release-6.2' into tls-background-eio-thread 2020-04-20 13:15:05 -07:00
Alex Miller 5c399bf725 Move the callbacks into ::run() right before it exits.
stopped=true doesn't cause the run loop to immediately exit.
2020-04-20 13:14:19 -07:00
Alex Miller 2ce539ef6d Respect flow<->fdbrpc module boundaries.
Which fixes a compilation error due to a circular dependency between
flow.a and fdbrpc.a.  However, this is now done at the cost of newNet2
users have to remember to add Net2FileSystem::stop() as a callback.
2020-04-20 02:53:07 -07:00
Alex Miller cbb6ffb431 Only log OpenSSL error strings for OpenSSL errors.
Normal "connection refused" messages would show up with a long verbose
string that doesn't really provide any useful information otherwise.
2020-04-18 20:39:02 -07:00
Alex Miller 11eebc4a48 Log Net2TLSConfig with paths and settings when using TLS.
There were similar TraceEvents in the FDBLibTLS/LibreSSL TLS
implementaiton that were accidentally dropped in the TLS rewrite.

This makes it so that one does not have to use magic to figure out if a
process was configued with TLS correctly when some of the settings come
from environment variables.
2020-04-18 20:21:10 -07:00
Alex Miller 1398e9a82e Stop background eio threads on Net2::stop().
This will stop eio threads for both the client (`fdb_stop_network()`)
and the server.  This change is being done more for the former, but I
don't see any harm in doing the latter as well.
2020-04-18 19:40:55 -07:00
A.J. Beamon d8690d31cd Merge branch 'master' into per-priority-busy-logging
# Conflicts:
#	flow/Net2.actor.cpp
2020-04-15 08:31:30 -07:00
A.J. Beamon b1172417f5 Merge branch 'master' into per-priority-busy-logging
# Conflicts:
#	flow/Knobs.cpp
#	flow/Knobs.h
#	flow/Net2.actor.cpp
2020-04-14 14:22:12 -07:00
A.J. Beamon e104a2e3a6 Merge commit 'cf01233f28a2c42908656a39f458a4475c1d44a3' into run-loop-busy-profiler
# Conflicts:
#	documentation/sphinx/source/release-notes.rst
#	fdbclient/NativeAPI.actor.h
#	fdbserver/fdbserver.actor.cpp
#	flow/Net2.actor.cpp
2020-04-14 14:02:24 -07:00
Evan Tschannen cf01233f28
Merge pull request #2549 from ajbeamon/slow-task-and-priority-tracking-improvements
Slow task and priority tracker improvements
2020-04-14 13:26:32 -07:00
A.J. Beamon 903128a36f Fix boost error trace event fields to match other trace events by the same name. 2020-04-01 08:18:50 -07:00
Evan Tschannen e08f0201f1 merge release 6.2 into master 2020-03-17 12:51:47 -07:00
Alex Miller db5863145a Merge remote-tracking branch 'upstream/release-6.2' into fdbcli-tlsinfo 2020-03-16 12:33:50 -07:00
Alex Miller 75e2fffe5a Add a ProcessMetrics.TLSPolicyFailures metric
This reports the number of policy failures over the past 5s interval.
It also is step 1 towards getting this information into status json.
2020-03-13 02:24:37 -07:00
Alex Miller 0c558efcfe Add a `tlsinfo` command to fdbcli that prints the certificate chain.
This requires the certificate chain to load successfully, otherwise
fdbcli will error out at an earlier point due to Net2 not being able to
configure TLS.
2020-03-13 00:11:53 -07:00
Evan Tschannen 303df197cf Merge branch 'release-6.2'
# Conflicts:
#	CMakeLists.txt
#	bindings/c/test/mako/mako.c
#	documentation/sphinx/source/release-notes.rst
#	fdbbackup/backup.actor.cpp
#	fdbclient/NativeAPI.actor.cpp
#	fdbclient/NativeAPI.actor.h
#	fdbserver/DataDistributionQueue.actor.cpp
#	fdbserver/Knobs.cpp
#	fdbserver/Knobs.h
#	fdbserver/LogRouter.actor.cpp
#	fdbserver/SkipList.cpp
#	fdbserver/fdbserver.actor.cpp
#	flow/CMakeLists.txt
#	flow/Knobs.cpp
#	flow/Knobs.h
#	flow/flow.vcxproj
#	flow/flow.vcxproj.filters
#	versions.target
2020-03-06 18:22:46 -08:00
Alex Miller 188d9b8239 Don't swallow actor cancellation in certificate refreshing. 2020-03-06 11:09:17 -08:00
Alex Miller 9b760fae2d Rewrite all Errors into tls_errors if they happen as part of initializing TLS. 2020-03-06 11:06:19 -08:00
Alex Miller ac52b6b474 Rework a bit of error and exception handling.
I went back and dug through all of the "what functions can throw what
types", and made sane decisions about them.  boost errors are
aggressively translated into FDB ones, whcih might result in multiple
lines of logging about errors, but this is in infrequently run code, so
it should be fine.
2020-03-06 02:33:16 -08:00
Alex Miller ccef3f7d05 Attempt to fix TLS_DISABLED compiles. 2020-03-05 17:32:10 -08:00