Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C] Implement low storage warning in the C driver. #1531

Merged
merged 7 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aeron-driver/src/main/c/aeron_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ void aeron_driver_context_print_configuration(aeron_driver_context_t *context)
fprintf(fpout, "\n mtu_length=%" PRIu64, (uint64_t)context->mtu_length);
fprintf(fpout, "\n ipc_mtu_length=%" PRIu64, (uint64_t)context->ipc_mtu_length);
fprintf(fpout, "\n file_page_size=%" PRIu64, (uint64_t)context->file_page_size);
fprintf(fpout, "\n low_file_store_warning_threshold=%" PRIu64, (uint64_t)context->low_file_store_warning_threshold);
fprintf(fpout, "\n publication_reserved_session_id_low=%" PRId32, context->publication_reserved_session_id_low);
fprintf(fpout, "\n publication_reserved_session_id_high=%" PRId32, context->publication_reserved_session_id_high);
fprintf(fpout, "\n loss_report_length=%" PRIu64, (uint64_t)context->loss_report_length);
Expand Down
78 changes: 64 additions & 14 deletions aeron-driver/src/main/c/aeron_driver_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,50 +276,51 @@ static void aeron_driver_untethered_subscription_state_change_null(
#define AERON_THREADING_MODE_DEFAULT AERON_THREADING_MODE_DEDICATED
#define AERON_DIR_DELETE_ON_START_DEFAULT false
#define AERON_DIR_DELETE_ON_SHUTDOWN_DEFAULT false
#define AERON_CLIENT_LIVENESS_TIMEOUT_NS_DEFAULT (10 * 1000 * 1000 * 1000LL)
#define AERON_CLIENT_LIVENESS_TIMEOUT_NS_DEFAULT (10 * 1000 * 1000 * INT64_C(1000))
#define AERON_TERM_BUFFER_LENGTH_DEFAULT (16 * 1024 * 1024)
#define AERON_IPC_TERM_BUFFER_LENGTH_DEFAULT (64 * 1024 * 1024)
#define AERON_TERM_BUFFER_SPARSE_FILE_DEFAULT (false)
#define AERON_PERFORM_STORAGE_CHECKS_DEFAULT (true)
#define AERON_LOW_FILE_STORE_WARNING_THRESHOLD_DEFAULT (AERON_TERM_BUFFER_LENGTH_DEFAULT * INT64_C(10))
#define AERON_SPIES_SIMULATE_CONNECTION_DEFAULT (false)
#define AERON_FILE_PAGE_SIZE_DEFAULT (4 * 1024)
#define AERON_MTU_LENGTH_DEFAULT (1408)
#define AERON_IPC_MTU_LENGTH_DEFAULT (1408)
#define AERON_IPC_PUBLICATION_TERM_WINDOW_LENGTH_DEFAULT (0)
#define AERON_PUBLICATION_TERM_WINDOW_LENGTH_DEFAULT (0)
#define AERON_PUBLICATION_LINGER_TIMEOUT_NS_DEFAULT (5 * 1000 * 1000 * 1000LL)
#define AERON_PUBLICATION_LINGER_TIMEOUT_NS_DEFAULT (5 * 1000 * 1000 * INT64_C(1000))
#define AERON_SOCKET_SO_RCVBUF_DEFAULT (128 * 1024)
#define AERON_SOCKET_SO_SNDBUF_DEFAULT (0)
#define AERON_SOCKET_MULTICAST_TTL_DEFAULT (0)
#define AERON_RECEIVER_GROUP_TAG_IS_PRESENT_DEFAULT false
#define AERON_RECEIVER_GROUP_TAG_VALUE_DEFAULT (-1)
#define AERON_FLOW_CONTROL_GROUP_TAG_DEFAULT (-1)
#define AERON_FLOW_CONTROL_GROUP_MIN_SIZE_DEFAULT (0)
#define AERON_FLOW_CONTROL_RECEIVER_TIMEOUT_NS_DEFAULT (5 * 1000 * 1000 * 1000LL)
#define AERON_FLOW_CONTROL_RECEIVER_TIMEOUT_NS_DEFAULT (5 * 1000 * 1000 * INT64_C(1000))
#define AERON_SEND_TO_STATUS_POLL_RATIO_DEFAULT (6)
#define AERON_RCV_STATUS_MESSAGE_TIMEOUT_NS_DEFAULT (200 * 1000 * 1000LL)
#define AERON_RCV_STATUS_MESSAGE_TIMEOUT_NS_DEFAULT (200 * 1000 * INT64_C(1000))
#define AERON_MULTICAST_FLOWCONTROL_SUPPLIER_DEFAULT ("aeron_max_multicast_flow_control_strategy_supplier")
#define AERON_UNICAST_FLOWCONTROL_SUPPLIER_DEFAULT ("aeron_unicast_flow_control_strategy_supplier")
#define AERON_CONGESTIONCONTROL_SUPPLIER_DEFAULT ("aeron_congestion_control_default_strategy_supplier")
#define AERON_IMAGE_LIVENESS_TIMEOUT_NS_DEFAULT (10 * 1000 * 1000 * 1000LL)
#define AERON_IMAGE_LIVENESS_TIMEOUT_NS_DEFAULT (10 * 1000 * 1000 * INT64_C(1000))
#define AERON_RCV_INITIAL_WINDOW_LENGTH_DEFAULT (128 * 1024)
#define AERON_LOSS_REPORT_BUFFER_LENGTH_DEFAULT (1024 * 1024)
#define AERON_PUBLICATION_UNBLOCK_TIMEOUT_NS_DEFAULT (15 * 1000 * 1000 * 1000LL)
#define AERON_PUBLICATION_CONNECTION_TIMEOUT_NS_DEFAULT (5 * 1000 * 1000 * 1000LL)
#define AERON_TIMER_INTERVAL_NS_DEFAULT (1 * 1000 * 1000 * 1000LL)
#define AERON_PUBLICATION_UNBLOCK_TIMEOUT_NS_DEFAULT (15 * 1000 * 1000 * INT64_C(1000))
#define AERON_PUBLICATION_CONNECTION_TIMEOUT_NS_DEFAULT (5 * 1000 * 1000 * INT64_C(1000))
#define AERON_TIMER_INTERVAL_NS_DEFAULT (1 * 1000 * 1000 * INT64_C(1000))
#define AERON_IDLE_STRATEGY_BACKOFF_DEFAULT "aeron_idle_strategy_backoff"
#define AERON_COUNTERS_FREE_TO_REUSE_TIMEOUT_NS_DEFAULT (1 * 1000 * 1000 * 1000LL)
#define AERON_COUNTERS_FREE_TO_REUSE_TIMEOUT_NS_DEFAULT (1 * 1000 * 1000 * INT64_C(1000))
#define AERON_PRINT_CONFIGURATION_DEFAULT (false)
#define AERON_RELIABLE_STREAM_DEFAULT (true)
#define AERON_TETHER_SUBSCRIPTIONS_DEFAULT (true)
#define AERON_UNTETHERED_WINDOW_LIMIT_TIMEOUT_NS_DEFAULT (5 * 1000 * 1000 * 1000LL)
#define AERON_UNTETHERED_RESTING_TIMEOUT_NS_DEFAULT (10 * 1000 * 1000 * 1000LL)
#define AERON_UNTETHERED_WINDOW_LIMIT_TIMEOUT_NS_DEFAULT (5 * 1000 * 1000 * INT64_C(1000))
#define AERON_UNTETHERED_RESTING_TIMEOUT_NS_DEFAULT (10 * 1000 * 1000 * INT64_C(1000))
#define AERON_DRIVER_TIMEOUT_MS_DEFAULT (10 * 1000)
#define AERON_RETRANSMIT_UNICAST_DELAY_NS_DEFAULT (0)
#define AERON_RETRANSMIT_UNICAST_LINGER_NS_DEFAULT (60 * 1000 * 1000LL)
#define AERON_RETRANSMIT_UNICAST_LINGER_NS_DEFAULT (60 * 1000 * INT64_C(1000))
#define AERON_NAK_MULTICAST_GROUP_SIZE_DEFAULT (10)
#define AERON_NAK_MULTICAST_MAX_BACKOFF_NS_DEFAULT (60 * 1000 * 1000LL)
#define AERON_NAK_UNICAST_DELAY_NS_DEFAULT (60 * 1000 * 1000LL)
#define AERON_NAK_MULTICAST_MAX_BACKOFF_NS_DEFAULT (60 * 1000 * INT64_C(1000))
#define AERON_NAK_UNICAST_DELAY_NS_DEFAULT (60 * 1000 * INT64_C(1000))
#define AERON_UDP_CHANNEL_TRANSPORT_BINDINGS_MEDIA_DEFAULT ("default")
#define AERON_UDP_CHANNEL_TRANSPORT_BINDINGS_INTERCEPTORS_DEFAULT ("")
#define AERON_RECEIVER_GROUP_CONSIDERATION_DEFAULT (AERON_INFER)
Expand Down Expand Up @@ -530,6 +531,7 @@ int aeron_driver_context_init(aeron_driver_context_t **context)
_context->initial_window_length = AERON_RCV_INITIAL_WINDOW_LENGTH_DEFAULT;
_context->loss_report_length = AERON_LOSS_REPORT_BUFFER_LENGTH_DEFAULT;
_context->file_page_size = AERON_FILE_PAGE_SIZE_DEFAULT;
_context->low_file_store_warning_threshold = AERON_LOW_FILE_STORE_WARNING_THRESHOLD_DEFAULT;
_context->publication_unblock_timeout_ns = AERON_PUBLICATION_UNBLOCK_TIMEOUT_NS_DEFAULT;
_context->publication_connection_timeout_ns = AERON_PUBLICATION_CONNECTION_TIMEOUT_NS_DEFAULT;
_context->counter_free_to_reuse_ns = AERON_COUNTERS_FREE_TO_REUSE_TIMEOUT_NS_DEFAULT;
Expand Down Expand Up @@ -826,6 +828,13 @@ int aeron_driver_context_init(aeron_driver_context_t **context)
4 * 1024,
INT32_MAX);

_context->low_file_store_warning_threshold = aeron_config_parse_size64(
AERON_LOW_FILE_STORE_WARNING_THRESHOLD_ENV_VAR,
getenv(AERON_LOW_FILE_STORE_WARNING_THRESHOLD_ENV_VAR),
_context->low_file_store_warning_threshold,
0,
INT64_MAX);

_context->publication_unblock_timeout_ns = aeron_config_parse_duration_ns(
AERON_PUBLICATION_UNBLOCK_TIMEOUT_ENV_VAR,
getenv(AERON_PUBLICATION_UNBLOCK_TIMEOUT_ENV_VAR),
Expand Down Expand Up @@ -1244,6 +1253,33 @@ static void aeron_driver_context_free_bindings(const aeron_udp_channel_intercept
}
}

int aeron_driver_context_run_storage_checks(aeron_driver_context_t *context, uint64_t log_length)
{
if (context->perform_storage_checks)
{
const uint64_t usable_space = context->usable_fs_space_func(context->aeron_dir);
if (usable_space < log_length)
{
AERON_SET_ERR(
-AERON_ERROR_CODE_STORAGE_SPACE,
"insufficient usable storage for new log of length=%" PRId64 " usable=%" PRId64 " in %s",
log_length, usable_space, context->aeron_dir);
return -1;
}

if (usable_space <= context->low_file_store_warning_threshold)
{
AERON_SET_ERR(
-AERON_ERROR_CODE_STORAGE_SPACE,
"WARNING: space is running low: threshold=%" PRId64 " usable=%" PRId64 " in %s",
context->low_file_store_warning_threshold, usable_space, context->aeron_dir);
aeron_distinct_error_log_record(context->error_log, aeron_errcode(), aeron_errmsg());
aeron_err_clear();
}
}
return 0;
}

int aeron_driver_context_bindings_clientd_create_entries(aeron_driver_context_t *context)
{
const aeron_udp_channel_interceptor_bindings_t *interceptor_bindings;
Expand Down Expand Up @@ -1751,6 +1787,20 @@ bool aeron_driver_context_get_perform_storage_checks(aeron_driver_context_t *con
return NULL != context ? context->perform_storage_checks : AERON_PERFORM_STORAGE_CHECKS_DEFAULT;
}

int aeron_driver_context_set_low_file_store_warning_threshold(aeron_driver_context_t *context, uint64_t value)
{
AERON_DRIVER_CONTEXT_SET_CHECK_ARG_AND_RETURN(-1, context);

context->low_file_store_warning_threshold = value;
return 0;
}

uint64_t aeron_driver_context_get_low_file_store_warning_threshold(aeron_driver_context_t *context)
{
return NULL != context ?
context->low_file_store_warning_threshold : AERON_LOW_FILE_STORE_WARNING_THRESHOLD_DEFAULT;
}

int aeron_driver_context_set_spies_simulate_connection(aeron_driver_context_t *context, bool value)
{
AERON_DRIVER_CONTEXT_SET_CHECK_ARG_AND_RETURN(-1, context);
Expand Down
3 changes: 3 additions & 0 deletions aeron-driver/src/main/c/aeron_driver_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ typedef struct aeron_driver_context_stct
uint64_t nak_unicast_delay_ns; /* aeron.nak.unicast.delay = 60ms */
uint64_t nak_multicast_max_backoff_ns; /* aeron.nak.multicast.max.backoff = 60ms */
uint64_t re_resolution_check_interval_ns; /* aeron.driver.reresolution.check.interval = 1s */
uint64_t low_file_store_warning_threshold; /* aeron.low.file.store.warning.threshold = 160MB */
size_t to_driver_buffer_length; /* aeron.conductor.buffer.length = 1MB + trailer*/
size_t to_clients_buffer_length; /* aeron.clients.buffer.length = 1MB + trailer */
size_t counters_values_buffer_length; /* aeron.counters.buffer.length = 1MB */
Expand Down Expand Up @@ -332,6 +333,8 @@ int aeron_driver_context_validate_mtu_length(uint64_t mtu_length);

size_t aeron_cnc_length(aeron_driver_context_t *context);

int aeron_driver_context_run_storage_checks(aeron_driver_context_t *context, uint64_t log_length);

int aeron_driver_context_bindings_clientd_create_entries(aeron_driver_context_t *context);
int aeron_driver_context_bindings_clientd_delete_entries(aeron_driver_context_t *context);
int aeron_driver_context_bindings_clientd_find_first_free_index(aeron_driver_context_t *context);
Expand Down
12 changes: 2 additions & 10 deletions aeron-driver/src/main/c/aeron_ipc_publication.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,9 @@ int aeron_ipc_publication_create(

*publication = NULL;

if (context->perform_storage_checks)
if (aeron_driver_context_run_storage_checks(context, log_length) < 0)
{
const uint64_t usable_space = context->usable_fs_space_func(context->aeron_dir);
if (usable_space < log_length)
{
AERON_SET_ERR(
-AERON_ERROR_CODE_STORAGE_SPACE,
"Insufficient usable storage for new log of length=%" PRId64 " usable=%" PRId64
" in %s", log_length, usable_space, context->aeron_dir);
return -1;
}
return -1;
}

if (aeron_alloc((void **)&_pub, sizeof(aeron_ipc_publication_t)) < 0)
Expand Down
12 changes: 2 additions & 10 deletions aeron-driver/src/main/c/aeron_network_publication.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,9 @@ int aeron_network_publication_create(

*publication = NULL;

if (context->perform_storage_checks)
if (aeron_driver_context_run_storage_checks(context, log_length) < 0)
{
const uint64_t usable_space = context->usable_fs_space_func(context->aeron_dir);
if (usable_space < log_length)
{
AERON_SET_ERR(
-AERON_ERROR_CODE_STORAGE_SPACE,
"Insufficient usable storage for new log of length=%" PRId64 " usable=%" PRId64
" in %s", log_length, usable_space, context->aeron_dir);
return -1;
}
return -1;
}

if (aeron_alloc((void **)&_pub, sizeof(aeron_network_publication_t)) < 0)
Expand Down
12 changes: 2 additions & 10 deletions aeron-driver/src/main/c/aeron_publication_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,9 @@ int aeron_publication_image_create(

*image = NULL;

if (context->perform_storage_checks)
if (aeron_driver_context_run_storage_checks(context, log_length) < 0)
{
const uint64_t usable_space = context->usable_fs_space_func(context->aeron_dir);
if (usable_space < log_length)
{
AERON_SET_ERR(
-AERON_ERROR_CODE_STORAGE_SPACE,
"Insufficient usable storage for new log of length=%" PRId64 " usable=%" PRId64
" in %s", log_length, usable_space, context->aeron_dir);
return -1;
}
return -1;
}

if (aeron_alloc((void **)&_image, sizeof(aeron_publication_image_t)) < 0)
Expand Down
8 changes: 8 additions & 0 deletions aeron-driver/src/main/c/aeronmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ bool aeron_driver_context_get_term_buffer_sparse_file(aeron_driver_context_t *co
int aeron_driver_context_set_perform_storage_checks(aeron_driver_context_t *context, bool value);
bool aeron_driver_context_get_perform_storage_checks(aeron_driver_context_t *context);

/**
* Specify the interval which checks for re-resolutions of names occurs.
*/
#define AERON_LOW_FILE_STORE_WARNING_THRESHOLD_ENV_VAR "AERON_LOW_FILE_STORE_WARNING_THRESHOLD"

int aeron_driver_context_set_low_file_store_warning_threshold(aeron_driver_context_t *context, uint64_t value);
uint64_t aeron_driver_context_get_low_file_store_warning_threshold(aeron_driver_context_t *context);

/**
* Should a spy subscription simulate a connection to a network publication.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int aeron_udp_channel_transport_init(
{
if (aeron_udp_channel_transport_setup_media_rcv_timestamps(transport) < 0)
{
AERON_APPEND_ERR("%s", "WARNING, unable to setup media timestamping");
AERON_APPEND_ERR("%s", "WARNING: unable to setup media timestamping");
aeron_distinct_error_log_record(context->error_log, aeron_errcode(), aeron_errmsg());
aeron_err_clear();
}
Expand Down
39 changes: 39 additions & 0 deletions aeron-driver/src/test/c/aeron_driver_context_config_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,42 @@ TEST_F(DriverContextConfigTest, shouldHandleValuesOutsideOfUint32Range)
EXPECT_EQ(1, aeron_driver_context_get_resource_free_limit(context));
aeron_driver_context_close(context);
}

TEST_F(DriverContextConfigTest, shouldReturnDefaultLowFileStoreWarningThresholdIfNoneProvided)
{
const uint64_t default_low_storage_warning_threshold = 160 * 1024 * 1024;

aeron_driver_context_t *context = nullptr;
EXPECT_EQ(default_low_storage_warning_threshold, aeron_driver_context_get_low_file_store_warning_threshold(context));

ASSERT_EQ(0, aeron_driver_context_init(&context));
EXPECT_EQ(default_low_storage_warning_threshold, aeron_driver_context_get_low_file_store_warning_threshold(context));
aeron_driver_context_close(context);
}

TEST_F(DriverContextConfigTest, shouldAssignLowStoreWarningThreshold)
{
aeron_driver_context_t *context = nullptr;
EXPECT_EQ(-1, aeron_driver_context_set_low_file_store_warning_threshold(context, 42));

const uint64_t threshold = 1024 * 1024;
ASSERT_EQ(0, aeron_driver_context_init(&context));
EXPECT_EQ(0, aeron_driver_context_set_low_file_store_warning_threshold(context, threshold));
EXPECT_EQ(threshold, aeron_driver_context_get_low_file_store_warning_threshold(context));
aeron_driver_context_close(context);
}

TEST_F(DriverContextConfigTest, shouldReadLowFileStoreWarningThresholdFromAnEnvironmentVariable)
{
aeron_driver_context_t *context = nullptr;
aeron_env_set(AERON_LOW_FILE_STORE_WARNING_THRESHOLD_ENV_VAR, "2m");
ASSERT_EQ(0, aeron_driver_context_init(&context));
EXPECT_EQ(2 * 1024 * 1024, aeron_driver_context_get_low_file_store_warning_threshold(context));
aeron_driver_context_close(context);

const uint64_t default_low_storage_warning_threshold = 160 * 1024 * 1024;
aeron_env_set(AERON_LOW_FILE_STORE_WARNING_THRESHOLD_ENV_VAR, "garbage");
ASSERT_EQ(0, aeron_driver_context_init(&context));
EXPECT_EQ(default_low_storage_warning_threshold, aeron_driver_context_get_low_file_store_warning_threshold(context));
aeron_driver_context_close(context);
}
53 changes: 47 additions & 6 deletions aeron-driver/src/test/c/aeron_ipc_publication_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ class IpcPublicationTest : public testing::Test

aeron_system_counters_init(&m_system_counters, &m_counters_manager);

aeron_distinct_error_log_init(
&m_error_log, m_error_log_buffer.data(), m_error_log_buffer.size(), aeron_epoch_clock);

m_context->error_log = &m_error_log;
m_context->error_buffer = m_error_log_buffer.data();
m_context->error_buffer_length = m_error_log_buffer.size();

aeron_driver_ensure_dir_is_recreated(m_context);
}

Expand All @@ -61,6 +68,7 @@ class IpcPublicationTest : public testing::Test

aeron_system_counters_close(&m_system_counters);
aeron_counters_manager_close(&m_counters_manager);
aeron_distinct_error_log_close(&m_error_log);
aeron_driver_context_close(m_context);
}

Expand Down Expand Up @@ -118,18 +126,15 @@ class IpcPublicationTest : public testing::Test
return publication;
}

static uint64_t noSpaceAvailable(const char* path)
{
return 0;
}

aeron_driver_context_t *m_context = nullptr;
private:
aeron_clock_cache_t m_cached_clock = {};
aeron_counters_manager_t m_counters_manager = {};
aeron_system_counters_t m_system_counters = {};
aeron_distinct_error_log_t m_error_log = {};
AERON_DECL_ALIGNED(buffer_t m_counter_value_buffer, 16) = {};
AERON_DECL_ALIGNED(buffer_4x_t m_counter_meta_buffer, 16) = {};
AERON_DECL_ALIGNED(buffer_t m_error_log_buffer, 16) = {};
std::vector<aeron_ipc_publication_t *> m_publications;
};

Expand All @@ -148,8 +153,44 @@ TEST_F(IpcPublicationTest, shouldCreatePublication)

TEST_F(IpcPublicationTest, shouldReturnStorageSpaceErrorIfNotEnoughStorageSpaceAvailable)
{
m_context->usable_fs_space_func = noSpaceAvailable;
m_context->usable_fs_space_func = [](const char* path) -> uint64_t
{
return 2049;
};
m_context->perform_storage_checks = true;

aeron_ipc_publication_t *publication = createPublication("aeron:ipc");

ASSERT_EQ(nullptr, publication) << aeron_errmsg();
EXPECT_EQ(-AERON_ERROR_CODE_STORAGE_SPACE, aeron_errcode());
auto expected_error_text =
std::string("insufficient usable storage for new log of length=4096 usable=2049 in ")
.append(m_context->aeron_dir);
EXPECT_NE(std::string::npos, std::string(aeron_errmsg()).find(expected_error_text));
}

TEST_F(IpcPublicationTest, shouldWarnIfRemainingStorageSpaceIsLow)
{
m_context->usable_fs_space_func = [](const char *path) -> uint64_t
{
return 1000000;
};
m_context->low_file_store_warning_threshold = 2020202020ULL;
m_context->perform_storage_checks = true;

aeron_ipc_publication_t *publication = createPublication("aeron:ipc");

ASSERT_NE(nullptr, publication) << aeron_errmsg();
EXPECT_EQ(0, aeron_errcode());
auto errors_list = m_context->error_log->observation_list;
EXPECT_NE(nullptr, errors_list);
EXPECT_NE(0, errors_list->num_observations);
auto last_error = errors_list->observations[errors_list->num_observations - 1];
EXPECT_EQ(-AERON_ERROR_CODE_STORAGE_SPACE, last_error.error_code);
auto error_text = std::string(last_error.description);
EXPECT_EQ(error_text.size(), last_error.description_length);
auto expected_warning =
std::string("WARNING: space is running low: threshold=2020202020 usable=1000000 in ")
.append(m_context->aeron_dir);
EXPECT_NE(std::string::npos, error_text.find(expected_warning));
}
Loading