Skip to content

Commit 7376223

Browse files
committed
Merge branch 'feature/json-sax-parsing-for-chaotic' of https://github.com/nmaks2012/userver into feature/json-sax-parsing-for-chaotic
2 parents ac2bd2a + 709353f commit 7376223

File tree

33 files changed

+437
-119
lines changed

33 files changed

+437
-119
lines changed

.github/workflows/publish-ubuntu-22.04-images.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ jobs:
1818
USERVER_IMAGE_TAG: ${{ github.event.release.tag_name || 'latest' }}
1919
steps:
2020
- uses: actions/checkout@v5
21+
22+
- name: Free disk space
23+
run: |
24+
df -h
25+
# See https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image
26+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/lib/php* /opt/ghc \
27+
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
28+
/opt/hostedtoolcache/CodeQL || true
29+
sudo docker image prune --all --force
30+
df -h
31+
2132
- name: Login to GitHub Container Registry
2233
uses: docker/login-action@v3
2334
with:

.github/workflows/publish-ubuntu-24.04-images.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ jobs:
1818
USERVER_IMAGE_TAG: ${{ github.event.release.tag_name || 'latest' }}
1919
steps:
2020
- uses: actions/checkout@v5
21+
22+
- name: Free disk space
23+
run: |
24+
df -h
25+
# See https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image
26+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/lib/php* /opt/ghc \
27+
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
28+
/opt/hostedtoolcache/CodeQL || true
29+
sudo docker image prune --all --force
30+
df -h
31+
2132
- name: Login to GitHub Container Registry
2233
uses: docker/login-action@v3
2334
with:

chaotic-openapi/chaotic_openapi/front/parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,12 @@ def parse_schema(self, schema: dict, full_filepath: str, full_vfilepath: str) ->
4747

4848
self._append_schema(parsed)
4949

50-
@staticmethod
51-
def _guess_parser(schema: dict):
50+
def _guess_parser(self, schema: dict):
5251
if 'openapi' in schema or 'components' in schema:
5352
return openapi.OpenApi
5453
elif 'swagger' in schema or 'definitions' in schema:
5554
return swagger.Swagger
56-
assert False, schema
55+
assert False, f"Don't know about file format ({self._state.full_filepath}): {schema}"
5756

5857
def _convert_openapi_header(
5958
self,

cmake/GetUserverVersion.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ else()
2222
endif()
2323

2424
file(READ ${USERVER_ROOT_DIR}/version.txt VERSION)
25-
string(REGEX MATCH ^[0-9]+ USERVER_MAJOR_VERSION "${VERSION}")
26-
string(REGEX MATCH [-0-9a-z]+$ USERVER_MINOR_VERSION "${VERSION}")
25+
string(STRIP ${VERSION} VERSION)
26+
string(REGEX MATCH "^([0-9]+)\.([0-9]+[\-a-z0-9]*)" USERVER_MATCHED_VERSION_STRING "${VERSION}")
27+
if(NOT USERVER_MATCHED_VERSION_STRING STREQUAL VERSION)
28+
message(FATAL_ERROR "Failed to retrieve userver major/minor version number from '${VERSION}'")
29+
endif()
30+
set(USERVER_MAJOR_VERSION ${CMAKE_MATCH_1})
31+
set(USERVER_MINOR_VERSION ${CMAKE_MATCH_2})
2732

2833
set(USERVER_VERSION "${USERVER_MAJOR_VERSION}.${USERVER_MINOR_VERSION}")
2934
string(REPLACE "-" "_" USERVER_VERSION_STR "${USERVER_VERSION}")

cmake/tsan.suppressions.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# ThreadSanitizer suppressions file as per https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions
1+
#######################################################################################################################
2+
# ThreadSanitizer suppressions file as per https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions #
3+
# #
4+
# Use it by setting environment variable TSAN_OPTIONS="suppressions=path-to/cmake/tsan.suppressions.txt" if userver #
5+
# is built with CMake option -DUSERVER_SANITIZE='thread' #
6+
#######################################################################################################################
27

38
# libev uses `sig_atomic_t volatile` for `EV_ATOMIC_T`, that is not atomic. However all the accesess are synchronized
49
# via assembly implemented memory barriers

core/src/engine/coro/marked_allocator.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ USERVER_NAMESPACE_BEGIN
44

55
namespace engine::coro::debug {
66

7-
static volatile const std::size_t page_size = MarkedAllocator::traits_type::page_size();
8-
static volatile std::size_t allocator_stack_size = MarkedAllocator::traits_type::default_size();
7+
// must be accessible from gdb
8+
// without __attribute__((used)) can be optimized out
9+
static const std::size_t page_size __attribute__((used)) = MarkedAllocator::traits_type::page_size();
10+
static std::size_t allocator_stack_size __attribute__((used)) = MarkedAllocator::traits_type::default_size();
911

1012
MarkedAllocator::MarkedAllocator(std::size_t size) : boost::coroutines2::protected_fixedsize_stack(size) {
1113
auto alignment = page_size;

core/src/engine/task/task_context.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ class TaskContext::ProfilerExecutionGuard {
497497

498498
void TaskContext::CoroFunc(TaskPipe& task_pipe) {
499499
for (TaskContext* context : task_pipe) {
500+
// `context` is accessed in gdb, do not rename
500501
UASSERT(context);
501502
context->task_pipe_ = &task_pipe;
502503

core/src/logging/component.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <userver/logging/log.hpp>
1717
#include <userver/logging/logger.hpp>
1818
#include <userver/os_signals/component.hpp>
19+
#include <userver/testsuite/testpoint.hpp>
1920
#include <userver/utils/algo.hpp>
2021
#include <userver/utils/statistics/writer.hpp>
2122
#include <userver/utils/thread_name.hpp>
@@ -211,6 +212,7 @@ void Logging::StopSocketLoggingDebug(const std::optional<logging::Level>& log_le
211212

212213
void Logging::OnLogRotate() {
213214
try {
215+
TESTPOINT("on-logrotate-called", formats::json::Value{});
214216
TryReopenFiles();
215217
} catch (const std::exception& e) {
216218
LOG_ERROR() << "An error occurred while ReopenAll: " << e;

core/src/server/middlewares/handler_adapter.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,12 @@ void HandlerAdapter::LogRequest(const http::HttpRequest& request, request::Reque
154154
misc::CutTrailingSlash(request.GetRequestPath(), handler_.GetConfig().url_trailing_slash);
155155

156156
logging::LogExtra log_extra{
157-
{tracing::kHttpMetaType, std::string{meta_type}},
158-
{tracing::kType, std::string{kTracingTypeRequest}},
157+
{tracing::kHttpMetaType, meta_type},
158+
{tracing::kType, kTracingTypeRequest},
159159
{"request_body_length", request.RequestBody().length()},
160-
{std::string{kTracingBody},
161-
handler_.GetRequestBodyForLoggingChecked(request, context, request.RequestBody())},
162-
{std::string{kTracingUri}, handler_.GetUrlForLoggingChecked(request, context)},
163-
{tracing::kHttpMethod, std::string{request.GetMethodStr()}},
160+
{kTracingBody, handler_.GetRequestBodyForLoggingChecked(request, context, request.RequestBody())},
161+
{kTracingUri, handler_.GetUrlForLoggingChecked(request, context)},
162+
{tracing::kHttpMethod, request.GetMethodStr()},
164163
};
165164
log_extra.Extend(GetHeadersLogExtra(
166165
need_log_request_headers, request, header_whitelist, handler_.GetConfig().request_headers_size_log_limit

grpc/include/userver/ugrpc/client/call_context.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include <grpcpp/client_context.h>
77

8-
#include <userver/tracing/span.hpp>
98
#include <userver/utils/impl/internal_tag_fwd.hpp>
109

1110
USERVER_NAMESPACE_BEGIN
@@ -33,9 +32,6 @@ class CallContext {
3332
/// @returns RPC name
3433
std::string_view GetCallName() const noexcept;
3534

36-
/// @returns RPC span
37-
tracing::Span& GetSpan() noexcept;
38-
3935
private:
4036
impl::CallState& state_;
4137
};

0 commit comments

Comments
 (0)