<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ydb/library/cpp/yt/system, branch main</title>
<subtitle>Mirror of YDB github repos</subtitle>
<id>https://code.mastervirt.ru/ydb/atom?h=main</id>
<link rel='self' href='https://code.mastervirt.ru/ydb/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/'/>
<updated>2026-06-06T21:16:49Z</updated>
<entry>
<title>Cache process/thread id getters and use them in TError origin capture</title>
<updated>2026-06-06T21:16:49Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-06-06T20:52:00Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=f10c7206fb31af8057446bceef9707aabaa9456e'/>
<id>urn:sha1:f10c7206fb31af8057446bceef9707aabaa9456e</id>
<content type='text'>
## Motivation
Profiling the YT master Automaton thread showed TOriginAttributes::Capture (run on every non-OK TError) spending ~60% of its time in a getpid() syscall — uncached on glibc &gt;= 2.25. NYT::GetCurrentThreadId() (gettid) feeds hot thread-affinity / log-manager checks on the same thread.

## Changes
- New library/cpp/yt/system/process_id.* with cached GetProcessId(); GetSystemThreadId() now caches the kernel tid in TLS. Both caches reset in the child after fork.
- Moved thread_name.{h,cpp} from misc to system.
- Removed GetCurrentProcessId/GetCurrentThreadId shims from yt/yt/core/misc/proc.{h,cpp}; migrated all callers to NYT::GetProcessId / NYT::GetSystemThreadId.
- TOriginAttributes::Capture uses the cached getters; recorded Tid is now the real kernel tid (matches perf/ps).
- Added microbenchmarks (library/cpp/yt/system/benchmarks, yt/yt/core/benchmarks/error.cpp).

## Microbenchmarks (release)
| | before | after |
|---|---|---|
| getpid | 101 ns | 0.33 ns |
| gettid | 102 ns | 1.64 ns |
| Capture | 161 ns | 50 ns |
| failed TError | 221 ns | 74 ns |
commit_hash:ee37ae57d61a5a2dd33daee935270f4bb93b7ff9
</content>
</entry>
<entry>
<title>Generalize GetEnvValueOrThrow with a typed conversion overload</title>
<updated>2026-06-03T08:26:50Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-06-03T08:02:37Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=b62b275069b9c743d3da207efbc6e03206212f47'/>
<id>urn:sha1:b62b275069b9c743d3da207efbc6e03206212f47</id>
<content type='text'>
Add a templated GetEnvValueOrThrow&lt;T&gt; that parses the environment variable value via FromString, next to the existing std::string overload.
commit_hash:0421b0463c473c8c7f88c0b1619484e52b002897
</content>
</entry>
<entry>
<title>Extract environment variables helpers to library/cpp/yt/system</title>
<updated>2026-05-01T12:04:18Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2026-05-01T11:47:58Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=4a9f78903be5ce431a47241af5126c08fb38c4f9'/>
<id>urn:sha1:4a9f78903be5ce431a47241af5126c08fb38c4f9</id>
<content type='text'>
commit_hash:5a11a7288f325d6fa0a9bec9a1ce0b7afa1f4984
</content>
</entry>
<entry>
<title>YT-18571: Refactor environ helpers</title>
<updated>2025-11-02T16:05:26Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2025-11-02T15:36:17Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=4b825604602f6a5491a132c6f3b5e0c7c899d997'/>
<id>urn:sha1:4b825604602f6a5491a132c6f3b5e0c7c899d997</id>
<content type='text'>
commit_hash:72977e13820ded4a38d19076b1d336c9bb910dbf
</content>
</entry>
<entry>
<title>Refactor local host name and YP cluster functions</title>
<updated>2025-02-02T09:43:24Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2025-02-02T09:13:55Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=c9f9f0a604f7c9472b05ee76b17ebf406a027c07'/>
<id>urn:sha1:c9f9f0a604f7c9472b05ee76b17ebf406a027c07</id>
<content type='text'>
commit_hash:a4ecfb1e06e82ba192646d3ab5417cb3f0c6991f
</content>
</entry>
<entry>
<title>YT-21233: Adjust (To/From)ErrorAttributeValue CPOs, revert ConvertTo becoming CPO, move TErrorCode and TError to library/cpp/yt/error</title>
<updated>2024-12-25T04:31:55Z</updated>
<author>
<name>arkady-e1ppa</name>
<email>arkady-e1ppa@yandex-team.com</email>
</author>
<published>2024-12-25T04:12:23Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=b5dd91799751f9924acb7c17ddad16ddb2086bba'/>
<id>urn:sha1:b5dd91799751f9924acb7c17ddad16ddb2086bba</id>
<content type='text'>
\[nodiff:caesar\]

List of changes:

 1) Make `ConvertTo` a normal function again (basically, a revert of previous change). It turned out to be very inconvenient entry point

 2) Introduce concept for "Primitive types" which are handled without yt/core module. Please note that inclusion of core **does not** affect work with primitive types (otherwise we would be facing and ODR violation). These are numerics, duration, instant, string-like objects and guid

 3) Introduce `FromErrorAttributeValue` which is a substitute to `ConvertTo` with special behavior (see below)

 4) Scheme for (de-)serialization has changed:

    1) Primitive types are handled via `ConvertToTextYsonString` and `ConvertFromTextYsonString`

    2) Other types are not supported without yt/core. Otherwise `ConvertToYsonString(value, EYsonFormat::Text)` used for serialization and `ConvertTo&lt;T&gt;(value)` for deserialization.

 5) New format of attribute value storage allows to not care about concrete type of the attribute (text yson strings can be detected since they start with `\"` and deserialized so are text yson bools, everything else is already human readable). This drops dependency on `TTokenizer`

 6) Some small parts (e.g. enums or constants or aliases) of yt/core/misc files were moved to library/cpp/yt/\* locations and re-included to drop dependencies of stripped\_error on them

 7) `TErrorAttributes` is now a simple hash map instead of a handle to `IAttributeDictionary`

 8) `ExtractFromAttributes` weak symbol is finally moved to library/cpp/yt/error due to point 9 allowing to fully drop dependency on `IAttributeDictionary`. Combined with point 7 this drops dep on yt/core/ytree altogether

 9) Moved `TErrorCode` to library/cpp/yt/error. There is a logger there which forces dep on library/cpp/yt/logging. It is not required really, and can be later removed

10) Moved `TError` with format and macroes to library/cpp/yt/error. It still (and probably forever will) depend on yson.

What can be done next: Switch TYsonString to TString and move ConvertTo/FromTextYsonString to library/cpp/yt/error. This would remove dep on library/cpp/yt/yson\_string
commit_hash:6f11dc478ab782a1f98a5aedcd45a4800d3f4e7b
</content>
</entry>
<entry>
<title>Better diagnostics in AbortProcess(Silently|Dramatically)</title>
<updated>2024-11-06T11:01:26Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2024-11-06T10:35:13Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=14a70ab65849ee4dcf734051372b1ff5be87a793'/>
<id>urn:sha1:14a70ab65849ee4dcf734051372b1ff5be87a793</id>
<content type='text'>
commit_hash:7bbc13afbd569ca9bb064aed656c12644fd2de96
</content>
</entry>
<entry>
<title>Refactor and unify exit codes</title>
<updated>2024-08-02T09:18:17Z</updated>
<author>
<name>babenko</name>
<email>babenko@yandex-team.com</email>
</author>
<published>2024-08-02T09:04:49Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=23b7c61b3876a421a9f239646c2f67c70877d21e'/>
<id>urn:sha1:23b7c61b3876a421a9f239646c2f67c70877d21e</id>
<content type='text'>
ec1d0c473e709e8aad76b4e190a75ad4125a9ce2
</content>
</entry>
<entry>
<title>YT-21566: Access thread local variables via noinline functions</title>
<updated>2024-04-25T23:41:13Z</updated>
<author>
<name>lukyan</name>
<email>lukyan@yandex-team.com</email>
</author>
<published>2024-04-25T23:21:44Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=5bbe44ff4e12b6d5496d56ecca97b0c4db340509'/>
<id>urn:sha1:5bbe44ff4e12b6d5496d56ecca97b0c4db340509</id>
<content type='text'>
970c33b44a7bd166b2716d86d3d2053dcaf05d7d
</content>
</entry>
<entry>
<title>feat contrib: aiogram 3</title>
<updated>2024-01-19T10:10:03Z</updated>
<author>
<name>armenqa</name>
<email>armenqa@yandex-team.com</email>
</author>
<published>2024-01-19T09:23:50Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=2de0149d0151c514b22bca0760b95b26c9b0b578'/>
<id>urn:sha1:2de0149d0151c514b22bca0760b95b26c9b0b578</id>
<content type='text'>
Relates: https://st.yandex-team.ru/, https://st.yandex-team.ru/
</content>
</entry>
</feed>
