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

ISPN-15916 Certificate reloading #12359

Merged
merged 1 commit into from
May 31, 2024

Conversation

tristantarrant
Copy link
Member

@tristantarrant tristantarrant added this to the 15.0.4.Final milestone May 8, 2024
private static FileWatcher INSTANCE;

private final Thread thread;
private final WatchService watchService;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've modified it to use plain last modified time

public void run() {
while (running) {
try {
Thread.sleep(SLEEP);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be making use of a ScheduledExecutorService and in the case of the server should we be creating this via NamedExecutorsFactory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also used by the client.

/**
* @since 15.0
*/
public class FileWatcher implements Runnable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use a WatchService instead? https://docs.oracle.com/javase/tutorial/essential/io/notification.html It should theoretically be more lightweight (don't have to check all registered files) and more responsive when file system supports (no sleeps required).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initial implementation did use that, but read #12359 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes. Sorry, I only looked at the code not the prior comments :D

@wburns wburns changed the title ISPN-15974 Certificate reloading ISPN-15916 Certificate reloading May 17, 2024
@ryanemerson
Copy link
Contributor

@tristantarrant This is breaking CI, there's also @wburns comment that needs addressing.

@tristantarrant
Copy link
Member Author

@tristantarrant This is breaking CI, there's also @wburns comment that needs addressing.

The first few runs of this PR in CI were broken because the PolarionJUnitXMLWriter imported a TestNG class, and since I cleaned up the dependencies a bit, this was cause a CNFE.
Now it's hanging in the BackupIT :)

@tristantarrant
Copy link
Member Author

Test failures are unrelated.

@ryanemerson ryanemerson merged commit 3dae029 into infinispan:main May 31, 2024
8 of 9 checks passed
@ryanemerson
Copy link
Contributor

Thanks @tristantarrant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants