Commit Graph

132 Commits

Author SHA1 Message Date
Vaidas Gasiunas 963630626c
Avoid loop profiler deadlocking in sanitizer builds by not calling backtrace (#9953) 2023-04-12 19:19:23 +02:00
Xiaoxi Wang 79d154317a fix windows build error: C:/ci/fdb_pr_builder/run/foundationdb/flow/Platform.actor.cpp(3769,18): error : variable has incomplete type 'struct sigaction' 2023-04-11 14:54:52 -07:00
A.J. Beamon f08825fdea Initialize the chained signal handler just in case it is possible that the new signal handler is installed prior to the old one being populated. 2023-04-04 09:26:07 -07:00
A.J. Beamon d9502b20bf Avoid a thread race trying to initialize the chained signal handler and calling it when handling SIGPROF 2023-04-03 09:55:09 -07:00
Vaidas Gasiunas 894f555e95
Test loop profiler using API Tester (#7174)
* Api Tester: Specify knobs in the toml file; Test loop profiler

* Gracefully stop the loop profiler thread

* Protect loop profiler thread by mutex

* Create loop  profiler thread only if is not stopped
2023-03-30 23:00:23 +02:00
A.J. Beamon ce31f6098b Use the same identifier for the thread ID syscall in both places we call it for the slow task profiler 2023-03-24 13:45:06 -07:00
A.J. Beamon c3809ef014 Make profileThread thread_local again. Add some error handling and comments. 2023-03-24 13:45:06 -07:00
A.J. Beamon f44f41c9fb Fix a usage of the wrong variable; separate the profiling enabled bool for the run loop and flow profilers. 2023-03-24 13:45:06 -07:00
A.J. Beamon 335c76501a The slow task profiler does not use thread local state that is not pre-initialized for dlopened objects. Chain signal handlers so that we call them for each external library. 2023-03-24 13:44:33 -07:00
Steve Atherton ccba8731dd
Math bug fix.
Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
2023-02-16 15:48:16 -08:00
Steve Atherton 4b19eee33e Adjust reported total space for a disk by the reserved space which normal users cannot use. 2023-02-15 19:01:30 -08:00
Xiaoge Su 50de69c897 Extract IConnection and NetworkAddress out from network.h 2023-01-24 14:48:31 -08:00
Xiaoge Su 3f03a6b12d Extract out IPAddress and IUDPSocket 2023-01-24 14:47:39 -08:00
A.J. Beamon 3e9b6ce937 Don't disallow a seed value of 0 2022-12-02 15:32:34 -08:00
Steve Atherton d169875423 Add a knob for whether to allow guard pages in memory allocations done via mmapInternal(). The knob defaults to false. 2022-10-16 19:55:07 -07:00
Andrew Noyes da6cf36149 Only register SIGTERM with crashHandler for USE_GCOV
Otherwise SIGTERM (and rightly so) causes TSAN to lose its noodle when
fdbmonitor kills fdbserver in the normal way.
2022-10-07 13:42:23 -07:00
A.J. Beamon e1fe28b78b Switch some usages of LiteralStringRef to use the _sr suffix 2022-09-30 16:04:16 -07:00
Andrew Noyes fee77c8702
Change crashAndDie to abort instead of segv (#7827)
* Change crashAndDie to abort instead of segv

This way we still terminate early when `--crash` is set, but folks
inspecting error reports don't get mislead and confuse assertion
failures with genuine memory errors.

* Add SIGABRT to crash handler
2022-09-23 11:06:53 -07:00
Xiaoge Su 970463223c
Merge branch 'main' into main 2022-09-20 16:56:56 -07:00
A.J. Beamon 4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
Xiaoge Su 3a9bf10d81 fixup! Try fix Windows build 2022-09-12 19:35:55 -07:00
Xiaoge Su 6b27f10a6c fixup! Fix windows compile 2022-09-12 14:44:38 -07:00
Markus Pilman 59ce49913a
Merge pull request #8146 from sfc-gh-tclinkenbeard/improve-code-coverage
Increase the number of unit tests run in `RandomUnitTests.toml`
2022-09-12 15:10:47 -06:00
Xiaoge Su 5996643f13 fixup! Fix the include file 2022-09-12 12:01:05 -07:00
Xiaoge Su 8130fce97f Update code per comments
Also sort #include in Platform.actor.cpp
2022-09-12 11:44:41 -07:00
sfc-gh-tclinkenbeard 5dbbd73879 Fix typo in __eraseDirectoryRecursiveCount variable name 2022-09-11 00:36:13 -07:00
Yi Wu d831c87d14
Add encryption metrics (#8070)
Adding the following metrics:
* BlobCipherKeyCache hit/miss
* EKP: KMS requests latencies
* For each component that using encryption, they now need to pass a UsageType enum to the encryption helper methods (GetEncryptCipherKeys/GetLatestEncryptCipherKey/encrypt/decrypt) and those methods will help to log get cipher key latency samples and encryption/decryption cpu times accordingly.
2022-09-09 18:43:09 -07:00
Andrew Noyes fbf5830bb2 Rollback #7374
Valgrind is complaining about use of uninitialized memory in
absl::GetStackTrace, and the cases where it complains the backtraces are
incomplete. Note: this means that jemalloc heap profiling no longer
works out of the box. Advanced users who want to enable jemalloc heap
profiling will now have to revert this change and build from source.
2022-09-06 16:55:18 -07:00
Junhyun Shim 71486cccb1
Make envvar access in envvar-knob parsing cross-platform (#7999)
* Make envvar access in envvar-knob parsing cross-platform

Variable `environ' is defined for Linux,
does not exist in Mac, and is deprecated in Windows

* Prevent env knob strings from being copied at each iteration

* Add headers for {Get|Free}EnvironmentStrings()

* Adjust for different memory layout of environ vs GetEnvironmentStrings()

GetEnvironmentStrings returns a single byte string
with adjacent key=value strings delimited with null bytes,
whereas environ is an array of key=value strings.

* Fix missing return value for Windows build

* Have just one return statement
2022-08-29 14:15:03 +02:00
Dan Lambright 50be189a0f Merge remote-tracking branch 'origin' into env 2022-08-23 17:01:48 -04:00
Marian Dvorsky e268ae9a86 Run clang-format 2022-08-08 18:48:15 +02:00
Marian Dvorsky b8370e5129 Print SIGNAL output to stdout 2022-08-08 18:28:11 +02:00
Marian Dvorsky 77269d0506 Print to stderr only upon errors 2022-08-08 18:11:35 +02:00
Marian Dvorsky 722f66beb7 Flush gcov coverage upon SIGTERM 2022-08-08 17:11:20 +02:00
Dan Lambright 473feef246 Set knobs using environment variables 2022-08-02 14:29:37 -04:00
Renxuan Wang 570db7a7d2
Fix processDiskReadSeconds and processDiskWriteSeconds. (#7608) 2022-07-18 13:47:45 -07:00
Junhyun Shim 8b70c7050d Apply RTLD_NODELETE for USE_SANITIZER builds
This allows their stack trace to be symbolized in CI/Jenkins XSAN runs
2022-07-18 19:25:12 +02:00
Markus Pilman 03d913a1de Flow compiling 2022-06-27 17:05:55 -06:00
Markus Pilman 10e478dfc3 Flow is compiling 2022-06-23 16:35:19 -06:00
Markus Pilman d35445a868 enforce include modularization in cmake 2022-06-23 14:37:35 -06:00
Andrew Noyes 83aceb216c
Use absl::GetStackTrace for slow task profiler (#7374)
* Make SlowTask workload runnable in joshua

* Remove SignalSafeUnwind, and use absl::GetStackTrace for slow task profiler
2022-06-15 14:53:52 -07:00
Mohamed Oulmahdi 26ad8bc184 Format 2022-05-31 14:17:41 +02:00
Mohamed Oulmahdi 81e81c6799 Fix atomicPath and abspath for Windows 2022-05-31 12:01:39 +02:00
Ata E Husain Bohra 33ae398268
REST KmsConnector implementation (#6994)
* REST KmsConnector implementation

Description
  diff-1: Address review comments.
          Add utility interface to Platform namespace to
          create and operate on tmpfile
 diff-2: Address review comments
         Link Boost::filesystem to CMake build process

Major changes includes:
1. Implement REST based KmsConnector implementation.
2. Salient features of the connector:
 2.1. Two required configuration are:
   a. Discovery KMS URLs - enable KMS discovery on bootstrap
   b. Endpoint path configuration to construct URI to fetch/refresh
      encryption keys
   c. Configuration to provide "validationTokens" to connect with
      external KMS. Patch implements file-based token validation scheme.
 2.2. On startup, RESTKmsConnector discovers KMS Urls and caches
      them in-memory. Extracts "validationTokens" based on input config.
 2.3. Expose endpoints to allow fetch/refresh of encryption keys.
 2.4. Defines JSON format to interact with external KMS - request &
      response payload format.
3. Extend Platform namespace with an interface to create and operate on
   tmp files.
4. Update Platform 'readFileBytes' and 'writeFileBytes' to leverage
   fstream supported implementation.

NOTE: KMS URLs fetched after initial discovery will be persisted using
      DynamicKnobs. It is TODO at the moment and shall be completed
      once DynamicKnobs is feature complete

Testing

Unit test to validation following:
1. Parsing on "validation tokens" logic.
2. Construction and parsing of REST JSON request and response strings.
2022-05-07 13:18:35 -07:00
sfc-gh-tclinkenbeard 258ba462e1 Remove !defined(_WIN32) guards for encryption code 2022-05-03 09:48:24 -07:00
sfc-gh-tclinkenbeard 7f05221cfe Removed TLS_DISABLED macro 2022-05-02 22:15:27 -07:00
Andrew Noyes 7ed82c1ac5
Mac m1 has 16k pages (#7038)
Previously the page guard implementation assumed that the page size was
4k. Also check for mmap and mprotect returning errors.
2022-05-02 14:24:43 -07:00
Andrew Noyes 297d831192
Put guard pages next to fast alloc memory (#6885)
* Put guard pages next to fast alloc memory

I verified that we can now detect #6753 without creating tons of
threads.

* Use pageSize instead of 4096

* Don't include mmapInternal for windows
2022-04-19 11:22:35 -07:00
Yi Wu 994b8c92f8
Add option to limit resident memory and remove default memory limit (#6719)
Changing `memory` option to limit resident memory instead of virtual memory, in config file and fdbserver/fdbbackup/fdbcli command-line argument. Since `rlimit` doesn't support limiting virtual memory, the current implementation have both of fdbmonitor and the fdbserver/fdbbackup process checking process RSS periodically and kill and restart the process if the limit is exceeded.

Adding a new `memory_vsize` option to limit virtual memory, if backward-compatible behavior is desired.

closes #6671, closes #6672
2022-04-06 20:06:24 -07:00
Steve Atherton 38190ad7e7
Merge pull request #6737 from sfc-gh-satherton/fix-storage-timestamps
Change storage metadata and perpetual wiggle timestamps to double epoch seconds
2022-04-02 09:47:23 -07:00