cloudfoundry / cloudfoundry/cf-java-client

UpdateProcessRequest cannot remove a timeout or invocationTimeout

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

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

Ngôn ngữ chính
Java
Star
334
Fork
319
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

We are on version 5.12.1-RELEASE.

The default ObjectMapper is configured with setSerializationInclusion(NON_NULL) .
When removing a timeout the request should set it explicitly to null, which is not possible using this configuration. Hence an UpdateProcessRequest can, by default, never remove a timeout.

See the following screenshot for a debugging example result

grafik

The code above is called by invoking the following Mono:

Mono.just("<app-id>")
                .flatMap(appId -> operator
                        .getCloudFoundryClient()
                        .applicationsV3()
                        .getProcess(GetApplicationProcessRequest.builder().applicationId(appId).type("web").build())
                        .flatMap(process -> {
                            return operator
                                    .getCloudFoundryClient()
                                    .processes().update(
                                            UpdateProcessRequest.builder()
                                                    .processId(process.getId())
                                                    .healthCheck(HealthCheck.builder()
                                                            .type(HealthCheckType.from(targetState.manifest().getHealthCheckType().toString()))
                                                            .data(Data.builder()
                                                                    .endpoint(targetState.manifest().getHealthCheckHttpEndpoint())
                                                                    .timeout(targetState.manifest().getTimeout())
                                                                    .build())
                                                            .build())
                                                    .build()
                                    ).doOnSuccess(updateProcessResponse -> {
                                        log.info("Updated health check for application");
                                    });
                        }).then()

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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.

Hướng nghiên cứu

Bắt đầu với cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/_DefaultConnectionContext.java, nơi ObjectMapper mặc định được cấu hình với NON_NULL, sau đó lần theo UpdateProcessRequest qua processes().update. Tái hiện trường hợp loại bỏ timeout từ issue và xác minh rằng timeout hoặc invocationTimeout được đặt rõ ràng thành null vẫn được giữ nguyên trong request gửi đi.

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

Đánh giá

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

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.