Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: passticket generation and limit eureka replication peers threads #2845

Merged
merged 10 commits into from
Mar 20, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
public class PassTicketService {

private IRRPassTicket irrPassTicket;
private final IRRPassTicket irrPassTicket;

public PassTicketService() {
this.irrPassTicket = ClassOrDefaultProxyUtils.createProxy(IRRPassTicket.class,
Expand All @@ -40,11 +40,13 @@ public PassTicketService() {
IRRPassTicketGenerationException.class, "getSafRc", "getRacfRc", "getRacfRsn"));
}

public void evaluate(String userId, String applId, String passTicket) throws IRRPassTicketEvaluationException {
// IRRPassTicket is not thread-safe, must be synchronized
public synchronized void evaluate(String userId, String applId, String passTicket) throws IRRPassTicketEvaluationException {
irrPassTicket.evaluate(userId.toUpperCase(), applId.toUpperCase(), passTicket.toUpperCase());
}

public String generate(String userId, String applId) throws IRRPassTicketGenerationException {
// IRRPassTicket is not thread-safe, must be synchronized
public synchronized String generate(String userId, String applId) throws IRRPassTicketGenerationException {
return irrPassTicket.generate(userId.toUpperCase(), applId.toUpperCase());
}

Expand Down Expand Up @@ -118,8 +120,8 @@ public String generate(String userId, String applId) throws IRRPassTicketGenerat
@Value
private static class UserApp {

private final String userId;
private final String applId;
String userId;
String applId;

}
}
Expand Down
1 change: 1 addition & 0 deletions discovery-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ eureka:
serviceUrl:
defaultZone: ${apiml.discovery.allPeersUrls}
server:
max-threads-for-peer-replication: 2
useReadOnlyResponseCache: false

management:
Expand Down