Skip to content

Commit 59d1eab

Browse files
authored
Merge pull request #10 from pagopa/fix-prod
fix PROD heap size, added alert log
2 parents 4790e0f + b628cd6 commit 59d1eab

File tree

6 files changed

+78
-7
lines changed

6 files changed

+78
-7
lines changed

helm/values-prod.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ microservice-chart:
1010
httpGet:
1111
path: /actuator/health/liveness
1212
port: 8080
13-
initialDelaySeconds: 90
13+
initialDelaySeconds: 60
1414
failureThreshold: 6
1515
periodSeconds: 10
1616
readinessProbe:
1717
httpGet:
1818
path: /actuator/health/readiness
1919
port: 8080
20-
initialDelaySeconds: 90
20+
initialDelaySeconds: 60
2121
failureThreshold: 6
2222
periodSeconds: 10
2323
deployment:
@@ -47,7 +47,7 @@ microservice-chart:
4747
memory: "512Mi"
4848
cpu: "0.25"
4949
limits:
50-
memory: "1G"
50+
memory: "4G"
5151
cpu: "1.0"
5252
autoscaling:
5353
enable: true
@@ -67,6 +67,7 @@ microservice-chart:
6767
APP_LOGGING_LEVEL: 'INFO'
6868
HIKARI_LOGGING_LEVEL: 'INFO'
6969
DEFAULT_LOGGING_LEVEL: 'INFO'
70+
JAVA_OPTS: "-XX:MaxHeapSize=2g"
7071
CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}'
7172
DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.p.db-nodo-pagamenti.com:5444/ndpspcp?prepareThreshold=0&currentSchema=NODO4_CFG"
7273
DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg"

infra/.terraform.lock.hcl

+62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheEhConsumer.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ public void processEvent(EventContext eventContext) {
5454
TargetRefreshEnum.cache.label,
5555
eventContext.getPartitionContext().getPartitionId(), eventContext.getEventData().getSequenceNumber(),
5656
eventContext.getEventData().getBodyAsString());
57-
apiConfigCacheService.syncCache();
57+
try {
58+
apiConfigCacheService.syncCache();
59+
} catch (Exception ex) {
60+
log.error("[{}][ALERT] Generic Error on consumer: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex);
61+
}
5862
}
5963

6064
public void processError(ErrorContext errorContext) {

src/main/java/it/gov/pagopa/node/cfgsync/service/ApiConfigCacheService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public Map<String, SyncStatusEnum> syncCache() {
107107
} catch(AppException appException) {
108108
throw appException;
109109
} catch (Exception ex) {
110-
log.error("[{}] error: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex);
110+
log.error("[{}][ALERT] Generic Error: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex);
111111
throw new AppException(AppError.INTERNAL_SERVER_ERROR);
112112
}
113113
}

src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerEhConsumer.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ public void processEvent(EventContext eventContext) {
5252
TargetRefreshEnum.standin.label,
5353
eventContext.getPartitionContext().getPartitionId(), eventContext.getEventData().getSequenceNumber(),
5454
eventContext.getEventData().getBodyAsString());
55-
standInManagerService.syncStandIn();
55+
try {
56+
standInManagerService.syncStandIn();
57+
} catch (Exception ex) {
58+
log.error("[{}][ALERT] Generic Error on consumer: {}", TargetRefreshEnum.standin.label, ex.getMessage(), ex);
59+
}
5660
}
5761

5862
public void processError(ErrorContext errorContext) {

src/main/java/it/gov/pagopa/node/cfgsync/service/StandInManagerService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public Map<String, SyncStatusEnum> syncStandIn() {
100100
} catch(AppException appException) {
101101
throw appException;
102102
} catch (Exception ex) {
103-
log.error("[{}] error: {}", TargetRefreshEnum.standin.label, ex.getMessage(), ex);
103+
log.error("[{}][ALERT] Generic Error: {}", TargetRefreshEnum.standin.label, ex.getMessage(), ex);
104104
throw new AppException(AppError.INTERNAL_SERVER_ERROR);
105105
}
106106
}

0 commit comments

Comments
 (0)