From f89705aecb48fd7afa8fa656bbc97f0f7aa26b16 Mon Sep 17 00:00:00 2001 From: msvinaykumar Date: Mon, 25 Nov 2024 19:10:42 +0530 Subject: [PATCH 1/2] Ensure access to the variable is synchronized Signed-off-by: msvinaykumar --- .../com/autotune/analyzer/serviceObjects/BulkJobStatus.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java b/src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java index 7dae51bb6..4ddb9d605 100644 --- a/src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java +++ b/src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java @@ -144,11 +144,11 @@ public void setTotal_experiments(int total_experiments) { this.total_experiments = total_experiments; } - public int getProcessed_experiments() { + public synchronized int getProcessed_experiments() { return processed_experiments; } - public void setProcessed_experiments(int processed_experiments) { + public synchronized void setProcessed_experiments(int processed_experiments) { this.processed_experiments = processed_experiments; } From 34cbbd7a2245e73b28d3f3b325f639de75bfd614 Mon Sep 17 00:00:00 2001 From: msvinaykumar Date: Mon, 25 Nov 2024 19:15:23 +0530 Subject: [PATCH 2/2] Ensure access to the variable is synchronized Signed-off-by: msvinaykumar --- .../com/autotune/analyzer/serviceObjects/BulkJobStatus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java b/src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java index 4ddb9d605..42a10b874 100644 --- a/src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java +++ b/src/main/java/com/autotune/analyzer/serviceObjects/BulkJobStatus.java @@ -41,7 +41,7 @@ public class BulkJobStatus { private String jobID; private String status; private int total_experiments; - private int processed_experiments; + private int processed_experiments; //todo : If the primary operations are increments or simple atomic updates, use AtomicInteger. It is designed for lock-free thread-safe access @JsonProperty("job_start_time") private String startTime; // Change to String to store formatted time @JsonProperty("job_end_time")