Skip to content

build a new release - #20

Merged
watashi-00 merged 44 commits into
buildfrom
master
Jul 29, 2026
Merged

build a new release#20
watashi-00 merged 44 commits into
buildfrom
master

Conversation

@watashi-00

Copy link
Copy Markdown
Owner

No description provided.

watashi-00 and others added 30 commits July 25, 2026 15:08
docs: remove debug logs from ServerManager and RouteRule
refactor: simplify RouteRule constructor logging
The cluster map uses node.getFullHost() as its key (e.g. 'http://localhost:8080'),
but ClusterManager.onClusterEvent() was calling updateStatusServer() with
statusEvent.nodeId() — which holds the node name — not the map key.

Since containsKey(nodeId) always returned false, the in-memory state of the
server was never updated after status-change events (ONLINE, UNSTABLE, etc).

Fix: use statusEvent.host() as the lookup key, which is set to node.getFullHost()
by the dispatcher (ThreadPingScheduler and ClusterService).
Previously the ConcurrentHashMap<String, ServerNode> used node.getFullHost()
(e.g. 'http://localhost:8080') as its key. This caused NodeStatusChanged events
to silently fail state updates because the event carried nodeId (the node name),
not the fullHost.

This commit migrates the key to node.getId() (the stable, immutable node name)
across all layers:

- Cluster.java: addClusterNode, validServer, updateStatusServer, updateServerNode,
  removeClusterNode, toggleAllServers, findNodeKey, endBootstrapPhase, registerServer,
  registerLoadedServer, staticNodes/persistedStaticNodes sets.
- LocalFilePersistenceAdapter.java: saveClusterState uses node.getId() as the
  persistence key; loadClusterStateProperties duplicate-guard uses node.getId().
- ClusterManager.java: onClusterEvent now correctly passes statusEvent.nodeId()
  (the stable identity) to updateStatusServer.
- TuiKeyHandler.java: deregisterServer uses node.getId().
- Tests updated: ClusterTest, L7RoutingTest, L4RoutingTest, StateOrchestrationTest
  all updated to use nodeId-based API.

All 94 tests pass.
…protocol

Each ServerNode now declares its routing protocol (HTTP, TCP, GRPC)
independently of its PingProtocol. Default is HTTP for full backward
compatibility. Fluent builder: gateway.registerNode(...).routingProtocol(TCP).register()
…outing

- ServerTransport.listen() now receives List<Cluster> instead of single Cluster
- ServerManager holds List<Cluster>, backward-compatible single-Cluster constructors preserved
- HttpTransport + UndertowHttpTransport: filter chain built per cluster; HTTP nodes
  only route traffic if routingProtocol == HTTP or GRPC
- TcpProxyTransport: routes to nodes across all clusters where routingProtocol == TCP
- Cluster.registerServer/registerLoadedServer: preserve routingProtocol on node copy
- Tests updated: transport.listen() calls wrapped with List.of(), L4 test nodes
  declared as RoutingProtocol.TCP
…ation

- ExternalAuthFilter: @order(20) filter that delegates auth to an external HTTP
  service. Forwards Authorization, X-Cluster-Token, X-Real-IP, X-Forwarded-For,
  Cookie and X-Original-URI headers. Returns 401 on denial, 502 on service error.
- GatewayBuilderPort: new authService(url) and authService(url, timeoutMs) methods
- LocalGatewayAdapter: implements both methods, wires ExternalAuthFilter via registerFilter()
refactor(HttpTransport): move imports, change http version to HTTP_1_1
fix(HttpTransport): add error handling for proxy requests
refactor(HttpTransport): improve code readability and structure
…y-hop response headers to maximize keep-alive connection reuse
…ecutor to prevent platform worker thread starvation under blocking L7 routing calls
…aultByteBufferPool to prevent direct memory OOM leaks under virtual threads load
…eap buffers to avoid thread pool lock contention under high concurrency
…e size to 2 to eliminate virtual thread ThreadLocal memory footprint bloat under high load
…cal custom routes to bypass virtual threads and blocking I/O stream overhead
…DK HttpTransport and reuse pooled byte arrays for L7 proxy stream copying in ReverseProxyService
…ter chain execution and full virtual threads execution for all routes, protecting event loops from developer blocking code
…ng annotation to run specific non-blocking local routes on the event loop
…oid redundant 16KB array allocations per request, reducing GC overhead and latency under high concurrency
…method

refactor(UndertowHttpTransport): extract route execution logic into separate method
fix(.gitignore): add .tmp to ignored files
chore(pom.xml): update version from 1.4.9-SNAPSHOT to 1.4.9-release
@watashi-00 watashi-00 self-assigned this Jul 29, 2026
@watashi-00
watashi-00 merged commit 75d40e2 into build Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant