Alert Dispatched event is not written while the server name is blank

Đang mở Phù hợp với người mới
#572 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend, observability

Hướng nghiên cứu

Đọc Alert.java ở dòng 59 và AlertWorker.java khoảng dòng 212, nơi issue cho biết giá trị ngữ cảnh null khiến việc tạo sự kiện thất bại. Theo dõi cách ActionTask tạo sự kiện “Alert Dispatched” và kiểm tra các bài kiểm thử liên quan có bao quát các cảnh báo chưa đặt tên máy chủ hay không. Tái hiện trường hợp cài đặt mới, sau đó xác nhận sự kiện được ghi mà không phát sinh ngoại lệ khi tên máy chủ để trống và vẫn bao gồm serverName khi tên này được đặt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

While the server name is blank (Settings, Server, Server Name, empty on a fresh install), alerts are sent but no "Alert Dispatched" event is written, and nothing is logged.

On 4.7.0, a fresh engine on Derby with nothing added:

  1. A channel whose JavaScript Writer destination throws (throw new Error('boom');), and a second channel to receive an alert's Channel action.
  2. An alert on any error of any channel, with a Channel action to the second channel.
  3. Send one message to the first channel. The destination errors and the alert's action delivers to the second channel. No "Alert Dispatched" event is written, and the log shows only the destination's own error.
  4. Set a Server Name and send another message. The action delivers again, and this time the event is written, with serverName among its attributes.

Alert.createContext puts serverName into the alert's context (Alert.java:59), and it is null until a name is set. AlertWorker.ActionTask.call() sends the actions, then builds the event by calling entry.getValue().toString() on every context value (AlertWorker.java:212), which throws on the null. The task runs through actionExecutor.submit(...) and nothing reads the returned Future, so the exception is not logged. Skipping null values when building the event, or using String.valueOf, looks like the fix; not tested.

Co-authored with Claude Code.

Ngôn ngữ chính
Java
Star
227
Fork
81
Merge trung bình
6 ngày 5 giờ
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OpenIntegrationEngine/engine

Tất cả issue của OpenIntegrationEngine/engine

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.