Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Non-Retryable requests when transactions are being used?

Đang mở
#1,886 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu với OkHttpServices.sendRequestWithRetry và các hàm gọi nó, đặc biệt là headImplExec và DocumentManagerImpl.exists, sử dụng stack trace và đối số transaction làm các điểm vào. Xem xét hành vi retry hiện có và các bài kiểm thử cho những lỗi dịch vụ tạm thời. Công việc được xem là hoàn tất khi quyết định retry phân biệt lỗi giao tiếp với việc xử lý transaction và bao quát yêu cầu exists mang tính transaction bằng các bài kiểm thử hồi quy.

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

Mô tả

Bug

We run our integration tests in gitlab in a dockerized environment, and since we started to use MarkLogic server transactions more we noticed our tests behaving increasingly flaky. We suspect the dockerized environment to induce some connection and availability issues. Here is a stacktrace of one of the issues:

com.marklogic.client.FailedRetryException: Service unavailable and maximum retry period elapsed: 0 seconds after 0 retries
	at com.marklogic.client.impl.OkHttpServices.sendRequestWithRetry(OkHttpServices.java:576)
	at com.marklogic.client.impl.OkHttpServices.headImplExec(OkHttpServices.java:1054)
	at com.marklogic.client.impl.OkHttpServices.headImpl(OkHttpServices.java:1016)
	at com.marklogic.client.impl.OkHttpServices.head(OkHttpServices.java:972)
	at com.marklogic.client.impl.DocumentManagerImpl.exists(DocumentManagerImpl.java:145)

The code leading into this trace is supposed to check, whether a document exists and looks like this:

final DocumentDescriptor documentDescriptor = manager.exists(docUri.toString(), transaction);

The transaction is non-null in the above statement. And as it turns out the OkHttpServices in line 1054:

return sendRequestWithRetry(requestBldr, (transaction == null), doHeadFunction, null);

renders a request using a transaction being "not retryable".

In a distributed system communication errors can happen, regardless of whether a transaction is being used or not. There should be a destinction being made depending on the type of error, whether it makes sense to repeat a request. The existence of a transaction should not make a difference here.

(We are currently using the marklogic-java-client in version 8.0.0 and the Markogic Server in 11.3.1)

Ngôn ngữ chính
Java
Star
61
Fork
74
Merge trung bình
2 ngày 53 phút
Pull request đã merge (30 ngày)
8

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 marklogic/java-client-api

Tất cả issue của marklogic/java-client-api

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.