summaryrefslogtreecommitdiffstats
path: root/vespalib
Commit message (Collapse)AuthorAgeFilesLines
* added simple profilerHåvard Pettersen2022-08-226-4/+369
|
* Merge pull request #23330 from ↵Henning Baldersheim2022-07-041-2/+2
|\ | | | | | | | | vespa-engine/toregge/fix-format-string-in-tsan-digest Fix format string in vespa-tsan-digest.
| * Fix format string in vespa-tsan-digest.Tor Egge2022-07-031-2/+2
| |
* | Merge pull request #23331 from ↵Henning Baldersheim2022-07-041-0/+1
|\ \ | | | | | | | | | | | | vespa-engine/toregge/include-csignal-to-get-declaration-of-kill Include csignal to get declaration of kill
| * | Include csignal to get declaration of killTor Egge2022-07-031-0/+1
| |/
* / GNU source is not required for boost stacktrace on darwin.Tor Egge2022-07-031-0/+3
|/
* Add noexcept specifier.Tor Egge2022-07-034-6/+6
|
* Refactor Capability(Set) and add more testingTor Brede Vekterli2022-06-305-70/+122
| | | | | | | Hide all nitty-gritty details of how capabilities map to internal bit set positions by making more of Capability private and only allowing CapabilitySet to see how the sausages are made. Move all bit set functionality to CapabilitySet, where it really belongs.
* Support mTLS connection-level capabilities and RPC access filtering in C++Tor Brede Vekterli2022-06-2933-312/+848
| | | | | | | | | | | | | | | | | | | | | | | | Adds the following: * Named capabilities and capability sets that represent (respectively) a single Vespa access API (such as Document API, search API etc) or a concrete subset of individual capabilities that make up a particular Vespa service (such as a content node). * A new `capabilities` array field to the mTLS authorization policies that allows for constraining what requests sent over a particular connection are allowed to actually do. Capabilities are referenced by name and may include any combination of capability sets and individual capabilities. If multiple capabilities/sets are configured, the resulting set of capabilities is the union set of all of them. * An FRT RPC-level access filter that can be set up as part of RPC method definitions. If set, filters are invoked prior to RPC methods. * A new `PERMISSION_DENIED` error code to FRT RPC that is invoked if an access filter denies a request. This also GCs the unused `AssumedRoles` concept which is now deprecated in favor of capabilities. Note: this is **not yet** a public or stable API, and capability names/semantics may change at any time.
* Avoid strlen when you already know ths length of the string.Henning Baldersheim2022-06-281-2/+2
|
* Merge pull request #23202 from ↵Henning Baldersheim2022-06-221-0/+5
|\ | | | | | | | | vespa-engine/toregge/remove-array-bounds-warning-in-vespalib Remove array-bounds warning (vespalib).
| * Remove array-bounds warning (vespalib).Tor Egge2022-06-221-0/+5
| |
* | add commentHåvard Pettersen2022-06-221-0/+2
| |
* | fix more undefined behaviorHåvard Pettersen2022-06-221-6/+14
|/
* Merge pull request #23183 from vespa-engine/havardpe/stop-passing-nullptrHåvard Pettersen2022-06-211-1/+3
|\ | | | | stop passing nullptr
| * stop passing nullptrHåvard Pettersen2022-06-211-1/+3
| |
* | too_big => throw_too_bigHenning Baldersheim2022-06-212-8/+8
| |
* | Inline hot path and keep error handling in .cpp file.Henning Baldersheim2022-06-212-31/+39
| |
* | Inline return AttrDFW::get_attribute() and clean up some old code with ↵Henning Baldersheim2022-06-211-32/+0
|/ | | | manual allocation.
* avoid unaligned accessHåvard Pettersen2022-06-202-6/+14
|
* enable making string handles directly from numbersHåvard Pettersen2022-06-163-0/+32
| | | | | used in peek/slice to avoid having to convert small numbers to strings before resolving the enum values.
* support VESPA_SHARED_STRING_REPO_NO_RECLAIM flagHåvard Pettersen2022-06-154-22/+78
|
* Merge pull request #23052 from vespa-engine/havardpe/common-memory-toolsHenning Baldersheim2022-06-132-95/+206
|\ | | | | common memory tools
| * use guards for unlikely casesHåvard Pettersen2022-06-131-8/+7
| |
| * common memory toolsHåvard Pettersen2022-06-102-95/+207
| |
* | shared string repo tweaksHåvard Pettersen2022-06-132-14/+17
|/ | | | | - 64 -> 256 partitions - 99999 -> 9999999 maximum small number
* fix undefined behavior in unit testsHåvard Pettersen2022-06-093-8/+26
|
* fix undefined behavior in unit tests -- WIPHåvard Pettersen2022-06-073-1/+12
|
* Remove test that invokes undefined pthread behaviorTor Brede Vekterli2022-06-072-12/+2
| | | | | | It is not well-defined to call a pthread function with a thread that is no longer valid. Remove test and add a precondition comment to the function that IDs must be valid.
* Remove vespalib::rmdir and vespalib::mkdirTor Egge2022-06-033-178/+23
|
* Merge pull request #22874 from ↵Tor Brede Vekterli2022-06-032-0/+7
|\ | | | | | | | | vespa-engine/vekterli/dump-stack-of-deadlocked-thread Let deadlock detector dump stack of potentially deadlocked threads
| * Let deadlock detector dump stack of potentially deadlocked threadsTor Brede Vekterli2022-06-022-0/+7
| | | | | | | | | | | | | | | | | | | | | | Enable cross-thread stack tracing as part of signal handler init code in both storage and proton daemons. Make deadlock detector parameters live configurable. Remove existing `restart` config definition annotations to reflect this. Remove dumping of bucket DB locks which hasn't really worked for a long time now.
* | Remove most use of vespalib::rmdir in vespalib. Deprecate vespalib::mkdir.Tor Egge2022-06-025-9/+14
|/
* Merge pull request #22788 from ↵Tor Brede Vekterli2022-06-026-26/+232
|\ | | | | | | | | vespa-engine/vekterli/add-cross-thread-stack-trace-dumping Add support for cross-thread stack dumping to vespalib
| * Really, really, really don't inline the backtrace-test functionTor Brede Vekterli2022-06-012-1/+2
| |
| * Ensure names are visible in backtrace by moving functions to a shared libraryTor Brede Vekterli2022-06-014-15/+35
| | | | | | | | Name resolving does not necessarily work for static functions.
| * No need to specify noinline for signal handler landing pad functionTor Brede Vekterli2022-06-011-3/+1
| |
| * Use compare_exchange to check and un-set pending signal handlerTor Brede Vekterli2022-06-011-3/+4
| |
| * Enable cross-thread stack tracing once for all testsTor Brede Vekterli2022-06-011-5/+5
| |
| * Simplify to just use seq_cst instead of rel/acq for signal handler completionTor Brede Vekterli2022-05-311-2/+2
| | | | | | | | Matches the use of seq_cst for the rest of the stack dumping logic.
| * Add support for cross-thread stack dumping to vespalibTor Brede Vekterli2022-05-304-26/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no existing API for conveniently getting the stack trace of any other thread than your own, so we have to turn things around a bit and make the target thread dump its own stack in a way that we can then safely access and return it. We allow for hooking SIGUSR2 at process startup time and use this as our dedicated stack dump signal internally. The process of stack dumping is then basically: 1. Caller sends SIGUSR2 to the target thread. This happens within a global mutex that ensures no other callers can attempt to dump stack at the same time. This is because we use a single, globally shared state between caller and target (the same signal handler function is used by all threads). 2. Caller acquire-polls (with 1ms sleep) for target thread signal handler completion. Fancy technologies such as mutexes and condition variables are not safe to use from within a signal handler and therefore cannot be used. 3. Target thread suddenly finds itself in Narnia (signal handler). Since the signal is the magical SIGUSR2, it proceeds to dump its stack frame addresses in a shared buffer. It then toggles completion, with release semantics, before returning to its regularly scheduled programming. 4. Caller exits poll-loop and assembles a complete stack trace from the frame addresses in the shared buffer, demangled and shiny. Signal-safe stack frame dumping currently uses Boost.Stacktrace, which is a header-only dependency and appears to use libunwind under the hood.
* | Merge pull request #22854 from vespa-engine/balder/inline-tensor-access-methodsHenning Baldersheim2022-06-022-10/+4
|\ \ | | | | | | - Optimize get_tensor_ref optimizing for no branches on happy path.
| * | - Optimize get_tensor_ref optimizing for no branches on happy path.Henning Baldersheim2022-06-012-10/+4
| | | | | | | | | | | | | | | - Also drop check for reference as that is done in the next called method. - Inline DirectTensorStore::get_tensor.
* | | Merge pull request #22851 from ↵Geir Storli2022-06-023-59/+14
|\ \ \ | | | | | | | | | | | | | | | | vespa-engine/toregge/convert-vespalib-rmdir-to-deprecated-shim Convert vespalib::rmdir to a deprecated shim.
| * | | Convert vespalib::rmdir to a deprecated shim.Tor Egge2022-06-013-59/+14
| | | |
* | | | Avoid huge amounts of cold code in hot path.Henning Baldersheim2022-06-021-0/+3
| | | |
* | | | If all else is equal the compiler will assume the if branch is more likely ↵Henning Baldersheim2022-06-021-10/+10
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than the else branch. This is based on experience since gcc 2.8 and til today, and is not a definitive truth. Just more likely. if (criteria) { most_likely_executed code } else { less_likely_executed code } While a single branched if is assumed less likely.
* | | When you have no special needs, you should just take the default allocator.Henning Baldersheim2022-06-012-1/+7
|/ /
* | vesapAndreas Eriksen2022-06-012-2/+2
| |
* | Avoid pulling in stringfmt.h in by moving code to .cpp file.Henning Baldersheim2022-05-312-2/+1
| |