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

CP-SAT(java): Log handler crash when having NumSearchWorkers > 1 #2775

Closed
Mizux opened this issue Sep 17, 2021 · 0 comments
Closed

CP-SAT(java): Log handler crash when having NumSearchWorkers > 1 #2775

Mizux opened this issue Sep 17, 2021 · 0 comments
Assignees
Labels
Bug Lang: Java Java wrapper issue Solver: CP-SAT Solver Relates to the CP-SAT solver
Projects
Milestone

Comments

@Mizux
Copy link
Collaborator

Mizux commented Sep 17, 2021

When using more than one worker, the log handler callback will crash the jvm

To reprodue

final CpSolver solver = new CpSolver();
StringBuilder logBuilder = new StringBuilder();
Consumer<String> appendToLog = (String message) -> {
  System.out.println(
  "Current Thread Name:" + Thread.currentThread().getName()
  + " Id:" + Thread.currentThread().getId()
  + " msg:" + message
  );
  logBuilder.append(message).append('\n');
};
solver.setLogCallback(appendToLog);
solver.getParameters()
  .setLogToStdout(false)
  .setLogSearchProgress(true)
  .setNumSearchWorkers(12);
CpSolverStatus status = solver.solve(model);
@Mizux Mizux added Bug Lang: Java Java wrapper issue Solver: CP-SAT Solver Relates to the CP-SAT solver labels Sep 17, 2021
@Mizux Mizux added this to the v9.1 milestone Sep 17, 2021
@Mizux Mizux added this to To do in ToDo via automation Sep 17, 2021
@Mizux Mizux self-assigned this Sep 17, 2021
@Mizux Mizux closed this as completed Sep 17, 2021
ToDo automation moved this from To do to Done Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Lang: Java Java wrapper issue Solver: CP-SAT Solver Relates to the CP-SAT solver
Projects
ToDo
  
Done
Development

No branches or pull requests

1 participant