Skip to content

Commit

Permalink
Merge pull request #10 from pagopa/fix-prod
Browse files Browse the repository at this point in the history
fix PROD heap size, added alert log
  • Loading branch information
aomegax authored Apr 11, 2024
2 parents 4790e0f + b628cd6 commit 59d1eab
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 7 deletions.
7 changes: 4 additions & 3 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ microservice-chart:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 90
initialDelaySeconds: 60
failureThreshold: 6
periodSeconds: 10
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 90
initialDelaySeconds: 60
failureThreshold: 6
periodSeconds: 10
deployment:
Expand Down Expand Up @@ -47,7 +47,7 @@ microservice-chart:
memory: "512Mi"
cpu: "0.25"
limits:
memory: "1G"
memory: "4G"
cpu: "1.0"
autoscaling:
enable: true
Expand All @@ -67,6 +67,7 @@ microservice-chart:
APP_LOGGING_LEVEL: 'INFO'
HIKARI_LOGGING_LEVEL: 'INFO'
DEFAULT_LOGGING_LEVEL: 'INFO'
JAVA_OPTS: "-XX:MaxHeapSize=2g"
CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}'
DB_NEXI_POSTGRES_URL: "jdbc:postgresql://db-postgres-ndp.p.db-nodo-pagamenti.com:5444/ndpspcp?prepareThreshold=0&currentSchema=NODO4_CFG"
DB_NEXI_POSTGRES_USER: "pp_nodo4_cfg"
Expand Down
62 changes: 62 additions & 0 deletions infra/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public void processEvent(EventContext eventContext) {
TargetRefreshEnum.cache.label,
eventContext.getPartitionContext().getPartitionId(), eventContext.getEventData().getSequenceNumber(),
eventContext.getEventData().getBodyAsString());
apiConfigCacheService.syncCache();
try {
apiConfigCacheService.syncCache();
} catch (Exception ex) {
log.error("[{}][ALERT] Generic Error on consumer: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex);
}
}

public void processError(ErrorContext errorContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Map<String, SyncStatusEnum> syncCache() {
} catch(AppException appException) {
throw appException;
} catch (Exception ex) {
log.error("[{}] error: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex);
log.error("[{}][ALERT] Generic Error: {}", TargetRefreshEnum.cache.label, ex.getMessage(), ex);
throw new AppException(AppError.INTERNAL_SERVER_ERROR);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public void processEvent(EventContext eventContext) {
TargetRefreshEnum.standin.label,
eventContext.getPartitionContext().getPartitionId(), eventContext.getEventData().getSequenceNumber(),
eventContext.getEventData().getBodyAsString());
standInManagerService.syncStandIn();
try {
standInManagerService.syncStandIn();
} catch (Exception ex) {
log.error("[{}][ALERT] Generic Error on consumer: {}", TargetRefreshEnum.standin.label, ex.getMessage(), ex);
}
}

public void processError(ErrorContext errorContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public Map<String, SyncStatusEnum> syncStandIn() {
} catch(AppException appException) {
throw appException;
} catch (Exception ex) {
log.error("[{}] error: {}", TargetRefreshEnum.standin.label, ex.getMessage(), ex);
log.error("[{}][ALERT] Generic Error: {}", TargetRefreshEnum.standin.label, ex.getMessage(), ex);
throw new AppException(AppError.INTERNAL_SERVER_ERROR);
}
}
Expand Down

0 comments on commit 59d1eab

Please sign in to comment.