Repository navigation
Description
Summary
A grouped batch of smaller robustness defects found while auditing lifecycle, caching and event delivery. Each is independently small; they are filed together because none warrants its own issue and all are one-liner-ish fixes.
Findings (all HEAD af4f67fd2)
1. PluginManager never stops a plugin whose startService() threw (resource leak). server/src/main/java/com/arcadedb/server/plugin/PluginManager.java:241-264 sets descriptor.setStarted(true) only after startService() returns, so stopPlugins() (:277-298) skips it via its !descriptor.isStarted() guard and stopService() is never called. Concrete instance: AutoBackupSchedulerPlugin.startService() calls scheduler.start() (creating a daemon ScheduledThreadPool, BackupScheduler.java:59) before scheduleAllDatabases(); if the latter throws, the pool leaks for the life of the JVM. Fix: on exception, call plugin.stopService() (guarded) before rethrowing.
2. WebSocket change events can be delivered twice on a last-unsubscribe / re-subscribe race. server/.../http/ws/WebSocketEventBus.java:67-81 removes the last subscriber and the watcher W1 from the maps inside lockFor(db), then calls W1.shutdown() (setting running=false) outside the lock. A concurrent subscribe(db) acquiring the lock in that gap creates watcher W2 and registers its listeners while W1 is still running with its listeners attached, so a commit in that window is enqueued on both and published twice to the (now current) subscriber. Fix: set running=false while still holding the per-database lock (e.g. a signalStop() at removal), leaving only the blocking runningLock.await() outside.
3. WebSocket authorization is checked only at SUBSCRIBE time. WebSocketReceiveListener.java:66-75 gates subscribe on user.canAccessToDatabase(database); WebSocketEventBus.publish() (:117-125) re-checks only subscription.isMatch(event), and the USER is captured once at handshake (WebSocketConnectionHandler.java:47). Revoking a user's database access (or deleting the user) does not stop the event stream until the client disconnects. Fix: re-validate on delivery, or invalidate live subscriptions on an ACL/user change — or document it as session semantics.
4. A slow (but not erroring) WebSocket subscriber accrues an unbounded send backlog. WebSocketEventBus.publish() fans out via fire-and-forget async WebSockets.sendText(...). Backpressure exists only on the producer side (DatabaseEventWatcherThread's bounded queue drops events when full, :59-64); there is no per-channel outstanding-bytes cap or slow-consumer eviction, so frames pile up in the subscriber's Undertow send buffer. Fix: cap per-channel outstanding sends and evict/close a subscriber past a threshold.
5. Vector index: a failed first-use materialization leaves nextId at 0, defeating the id-reuse guard. engine/src/main/java/com/arcadedb/index/vector/LSMVectorIndex.java:1215-1224 — materializeLocations() catches a parse failure, logs a WARNING, and in its finally still sets locationsMaterialized = true; nextId is only advanced at the end of loadVectorsFromPages() (:3774). A corrupt/truncated page that throws after some entries were inserted leaves nextId == 0 with materialization marked done (one-attempt contract), so allocateVectorId() — which exists precisely to stop ids restarting at 0 and superseding live entries (javadoc :1233-1236) — hands out 0,1,2,… and residentLocations.addOrUpdate(0,…) overwrites a live vector. Fix: on the failure path set nextId from whatever was read, or mark the index INVALID rather than accepting writes with an uninitialized allocator.
6. RemoteGrpcServer.channel is read without synchronization and is not volatile. grpc-client/src/main/java/.../RemoteGrpcServer.java (field ~:80, channel() :152-159) — mutated only under synchronized (start()/close()) but read unsynchronized, so a reader racing close()/first start() has no happens-before and may observe a stale value. Fix: mark channel (and eventLoopGroup) volatile.
7. MCP tools: two missing input bounds. mcp/.../tools/ProfilerStartTool.java:61,70 declares minimum:1, maximum:3600 for timeoutSeconds in its schema but performs no server-side range check before profiler.start(timeout) — unlike every sibling tool (SampleRecordsTool.java:82-83, FullTextSearchTool.java:97-98, VectorSearchTool.java:101-102), so 0/negative/huge values pass through (root-only, so low impact). And QueryTool.java:72 / ExecuteCommandTool.java:75 read limit with no upper bound, accumulating every row into an in-memory JSONArray (QueryTool.java:92-101), while the vector/sample/full-text tools all cap their windows. Fix: re-validate the declared range; clamp limit to a maximum as the sibling tools do.
Scope / confidence
Each verified in source at HEAD. Severities are low: #1/#5 need an exceptional failure path, #2/#3/#4 are narrow-window or session-semantics, #6 is a JMM visibility gap, #7 is admin/authenticated input validation. Concurrency items are reasoned, not executed.
Activity
fix: address the first review round on #6758-#6762
Merge pull request #6783 from ArcadeData/fix/6757-6762-robustness-batch
lvca commentedon Aug 26, 2026
All seven fixed in #6783.
arcadedb.server.eventBusMaxPendingBytes(16 MB by default,0disables), instead of accumulating unsent messages in server memory without limit.profiler_start,queryandexecute_commandtools now validate their numeric inputs server-side, so an out-of-rangelimitis rejected instead of materializing an unbounded result in memory.Available in 26.9.1.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#6757,ArcadeData#6758,ArcadeData#6759,ArcadeData#6760,A…
docs(#6837): reword the release-note paragraph that opened with a bar…