Skip to content

Commit

Permalink
Merge branch 'hoytech:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Jan 10, 2025
2 parents 809e826 + 542552a commit b372b08
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
10 changes: 10 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
1.0.4
* New config: maxReqFilterSize. This allows REQs with many more filters (jb55)
* Default maxReqFilterSize was increased to 200
* Update nix build file (jb55)
* Reduces log spam by not dumping full invalid events (Kroese)
* In sync and stream commands, provide the connected URL to write policy
plugins (Kroese)
* Bugfix in router: The configured connection timeout was not applied on
the first connection, forcing a retry.

1.0.3
* Use negentropy error message format specified in NIP-77

Expand Down
1 change: 0 additions & 1 deletion src/WriterPipeline.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include<string.h>
#include <hoytech/protected_queue.h>

#include "golpe.h"
Expand Down
27 changes: 15 additions & 12 deletions src/apps/mesh/cmd_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,21 @@ struct Router {
try {
auto routerConfig = loadRawTaoConfig(routerConfigFile);

// connectionTimeout

uint64_t newTimeoutUs = defaultConnectionTimeoutUs;
if (routerConfig.get_object().contains("connectionTimeout")) {
newTimeoutUs = routerConfig.at("connectionTimeout").get_unsigned() * 1'000'000;
}

if (connectionTimeoutUs != newTimeoutUs) {
connectionTimeoutUs = newTimeoutUs;
LI << "Using connection timeout: " << (connectionTimeoutUs / 1'000'000) << " seconds";
// FIXME: this won't actually update the cron.repeat() frequency, so no hot reconfigs
}

// load streamGroups

for (const auto &[groupName, spec] : routerConfig.at("streams").get_object()) {
if (!streamGroups.contains(groupName)) {
LI << "New stream group [" << groupName << "]";
Expand All @@ -314,18 +329,6 @@ struct Router {
for (const auto &[groupName, spec] : routerConfig.at("streams").get_object()) unneededGroups.erase(groupName);
for (const auto &groupName : unneededGroups) streamGroups.erase(groupName);
}

// connectionTimeout

uint64_t newTimeoutUs = defaultConnectionTimeoutUs;
if (routerConfig.get_object().contains("connectionTimeout")) {
newTimeoutUs = routerConfig.at("connectionTimeout").get_unsigned() * 1'000'000;
}

if (connectionTimeoutUs != newTimeoutUs) {
connectionTimeoutUs = newTimeoutUs;
LI << "Using connection timeout: " << (connectionTimeoutUs / 1'000'000) << " seconds";
}
} catch (std::exception &e) {
LE << "Failed to parse router config: " << e.what();
if (!firstConfigLoadSuccess) ::exit(1);
Expand Down
3 changes: 1 addition & 2 deletions src/apps/relay/golpe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ config:
noReload: true
- name: relay__maxReqFilterSize
desc: "Maximum number of filters allowed in a REQ"
default: 20
noReload: true
default: 200
- name: relay__autoPingSeconds
desc: "Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts)"
default: 55
Expand Down
2 changes: 1 addition & 1 deletion strfry.conf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ relay {
maxWebsocketPayloadSize = 131072

# Maximum number of filters allowed in a REQ
maxReqFilterSize = 20
maxReqFilterSize = 200

# Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts) (restart required)
autoPingSeconds = 55
Expand Down

0 comments on commit b372b08

Please sign in to comment.