Fix: deadlock in /clear endpoint — move write_status() outside events_lock
write_status() calls get_current_state() which re-acquires events_lock. Calling it inside the `with events_lock:` block caused the same thread to block forever (threading.Lock is not reentrant). Any /clear request would hang the aggregator indefinitely, breaking detector recovery flow. Bump to v2.3.2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -271,12 +271,12 @@ def clear_event():
|
||||
event_id = str(data["id"])
|
||||
|
||||
with events_lock:
|
||||
if event_id in active_events:
|
||||
del active_events[event_id]
|
||||
state = write_status()
|
||||
return jsonify({"status": "cleared", "current_state": state}), 200
|
||||
else:
|
||||
if event_id not in active_events:
|
||||
return jsonify({"error": "Event not found"}), 404
|
||||
del active_events[event_id]
|
||||
|
||||
state = write_status()
|
||||
return jsonify({"status": "cleared", "current_state": state}), 200
|
||||
|
||||
|
||||
@app.route("/notify", methods=["POST"])
|
||||
|
||||
Reference in New Issue
Block a user