-
Notifications
You must be signed in to change notification settings - Fork 0
WIRE_PROTOCOL_BUG_FIX
Wire Protocol Server schlug mit Fehler fehl:
Fatal error: remote_endpoint: Bad file descriptor
[system:9 at reactive_socket_service.hpp:218:7]
Bug in Session-Konstruktor: client_ip_ wurde aus socket_.remote_endpoint() gelesen BEVOR der Socket akzeptiert wurde.
// BUG: Socket wurde noch nicht akzeptiert!
WireProtocolServer::Session::Session(uint64_t session_id, tcp::socket socket, WireProtocolServer* server)
: session_id_(session_id)
, socket_(std::move(socket))
, server_(server)
{
client_ip_ = socket_.remote_endpoint().address().to_string(); // ❌ Socket nicht ready!
}Defer remote_endpoint access bis nach accept():
-
Session-Konstruktor:
client_ip_mit "unknown" initialisieren -
Session::start(): Nach akzeptiertem Socket
client_ip_setzen - WireProtocolServer::handleAccept(): Remote IP direkt aus akzeptiertem Socket auslesen
- Zeile ~200: Session-Konstruktor
// VORHER:
client_ip_ = socket_.remote_endpoint().address().to_string(); // ❌ BUG
// NACHHER:
client_ip_("unknown") // Will be set after accept in start()- Zeile ~210: Session::start()
void WireProtocolServer::Session::start() {
try {
client_ip_ = socket_.remote_endpoint().address().to_string(); // ✅ Jetzt safe!
} catch (const std::exception& e) {
client_ip_ = "unknown";
}
startTimeout(...);
asyncReadHeader();
}- Zeile ~155: WireProtocolServer::handleAccept()
void WireProtocolServer::handleAccept(std::shared_ptr<Session> session,
const boost::system::error_code& error) {
if (!error) {
// Get remote IP AFTER socket accepted
std::string remote_ip = "unknown";
try {
remote_ip = session->socket_.remote_endpoint().address().to_string(); // ✅ Safe
} catch (...) {
}
// Use remote_ip for checks...
if (!checkConnectionLimit(remote_ip)) { ... }
if (!checkRateLimit(remote_ip)) { ... }
registerConnection(remote_ip);
session->start();
}
doAccept();
}[✓] Kompilierung erfolgreich (nur minor unused-parameter Warnungen)
[✓] Binary: 34 MB (build-wsl/themis_server)
[✓] Docker Image: themis-db:wire-protocol-latest (160 MB)
[✓] Container: themis-wire (läuft)
[✓] Uptime: 67+ Sekunden
HTTP REST (Port 8765):
curl -v http://localhost:8765/health
# Output:
# {"database":"themis","status":"healthy","uptime_seconds":67,"version":"0.1.0"}
# Status: 200 OK ✓Wire Protocol (Port 8766):
nc -zv localhost 8766
# Output: Connection to localhost (127.0.0.1) 8766 port [tcp/*] succeeded! ✓[2025-12-04 18:36:42.597] [themis] [info] === Themis Multi-Model Database API Server ===
[2025-12-04 18:36:42.597] [themis] [info] === Version: 1.0.0
[2025-12-04 18:36:42.597] [themis] [info] === Features: Multi-Model, ACID, MVCC, Graph, Vector
[2025-12-04 18:36:42.597] [themis] [info] PROTOCOLS:
[2025-12-04 18:36:42.597] [themis] [info] ✓ HTTP REST: http://0.0.0.0:8765
[2025-12-04 18:36:42.597] [themis] [info] ✓ Wire Protocol: tcp://0.0.0.0:8766 (native binary)
[2025-12-04 18:36:42.597] [themis] [info] STATUS: READY FOR CONNECTIONS ✓
[2025-12-04 18:36:42.597] [themis] [info] HTTP Server started successfully ✓
[2025-12-04 18:36:42.597] [themis] [info] Starting Wire Protocol server on port 8766... ✓
- ✓ Graph Traversal & Pattern Matching
- ✓ Vector Search (HNSW index)
- ✓ Geo-Spatial Queries (R-Tree)
- ✓ AQL Query Language
- ✓ MVCC Transactions
- ✓ ContentFS (Binary Storage)
# Build (optional, image already built)
wsl bash docker-build-fast.sh
# Run
docker run -d \
-p 8765:8765 \
-p 8766:8766 \
-v themis_data:/data \
--name themis-wire \
themis-db:wire-protocol-latest
# Verify
curl http://localhost:8765/health # HTTP ✓
nc -zv localhost 8766 # Wire Protocol ✓
docker logs themis-wire # Logs# Check status
docker ps -a | grep themis-wire
# View logs
docker logs -f themis-wire
# Stop
docker stop themis-wire
# Remove
docker rm themis-wire
# Remove image
docker rmi themis-db:wire-protocol-latest-
Benchmarks: Wire Protocol vs PostgreSQL vs MongoDB
- Connection performance
- Query latency
- Throughput
- Memory usage
-
Client SDK Development:
- Wire Protocol client libraries (C++, Python, Node.js, Java)
- Connection pooling
- Retry logic
-
Production Hardening:
- TLS/SSL support
- Authentication
- Metrics collection
- Rate limiting tuning
Issue: Attempting to read remote endpoint before socket acceptance Severity: Critical (prevents Wire Protocol server startup) Fix: Defer remote_endpoint access to post-acceptance phase Impact: Wire Protocol fully operational on production container
ThemisDB v1.3.4 | GitHub | Documentation | Discussions | License
Last synced: January 02, 2026 | Commit: 6add659
Version: 1.3.0 | Stand: Dezember 2025
- Übersicht
- Home
- Dokumentations-Index
- Quick Reference
- Sachstandsbericht 2025
- Features
- Roadmap
- Ecosystem Overview
- Strategische Übersicht
- Geo/Relational Storage
- RocksDB Storage
- MVCC Design
- Transaktionen
- Time-Series
- Memory Tuning
- Chain of Thought Storage
- Query Engine & AQL
- AQL Syntax
- Explain & Profile
- Rekursive Pfadabfragen
- Temporale Graphen
- Zeitbereichs-Abfragen
- Semantischer Cache
- Hybrid Queries (Phase 1.5)
- AQL Hybrid Queries
- Hybrid Queries README
- Hybrid Query Benchmarks
- Subquery Quick Reference
- Subquery Implementation
- Content Pipeline
- Architektur-Details
- Ingestion
- JSON Ingestion Spec
- Enterprise Ingestion Interface
- Geo-Processor Design
- Image-Processor Design
- Hybrid Search Design
- Fulltext API
- Hybrid Fusion API
- Stemming
- Performance Tuning
- Migration Guide
- Future Work
- Pagination Benchmarks
- Enterprise README
- Scalability Features
- HTTP Client Pool
- Build Guide
- Implementation Status
- Final Report
- Integration Analysis
- Enterprise Strategy
- Verschlüsselungsstrategie
- Verschlüsselungsdeployment
- Spaltenverschlüsselung
- Encryption Next Steps
- Multi-Party Encryption
- Key Rotation Strategy
- Security Encryption Gap Analysis
- Audit Logging
- Audit & Retention
- Compliance Audit
- Compliance
- Extended Compliance Features
- Governance-Strategie
- Compliance-Integration
- Governance Usage
- Security/Compliance Review
- Threat Model
- Security Hardening Guide
- Security Audit Checklist
- Security Audit Report
- Security Implementation
- Development README
- Code Quality Pipeline
- Developers Guide
- Cost Models
- Todo Liste
- Tool Todo
- Core Feature Todo
- Priorities
- Implementation Status
- Roadmap
- Future Work
- Next Steps Analysis
- AQL LET Implementation
- Development Audit
- Sprint Summary (2025-11-17)
- WAL Archiving
- Search Gap Analysis
- Source Documentation Plan
- Changefeed README
- Changefeed CMake Patch
- Changefeed OpenAPI
- Changefeed OpenAPI Auth
- Changefeed SSE Examples
- Changefeed Test Harness
- Changefeed Tests
- Dokumentations-Inventar
- Documentation Summary
- Documentation TODO
- Documentation Gap Analysis
- Documentation Consolidation
- Documentation Final Status
- Documentation Phase 3
- Documentation Cleanup Validation
- API
- Authentication
- Cache
- CDC
- Content
- Geo
- Governance
- Index
- LLM
- Query
- Security
- Server
- Storage
- Time Series
- Transaction
- Utils
Vollständige Dokumentation: https://makr-code.github.io/ThemisDB/