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

Refresh IServiceProviderPlaces #1070

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dev-mlb
Copy link
Collaborator

@dev-mlb dev-mlb commented Feb 22, 2025

Brute force way to refresh services/places --

  1. Invalidate services
  2. Pause server
  3. Wait for agents to drain
  4. Refresh services
  5. Unpause if all succeed, kill the server if failures

To force refresh, hit the api endpoint -- http://localhost:8001/api/refresh

Sample output:

2025-02-22T23:33:29.280 [localhost-8001] INFO  emissary.server.EmissaryServer -   - Invalidating places that need to be reconfigured
2025-02-22T23:33:29.282 [localhost-8001] INFO  emissary.place.RefreshableServiceProviderPlace -   - Place[emissary.place.sample.RefreshablePlace] being marked as invalidated
2025-02-22T23:33:29.284 [localhost-8001] INFO  emissary.pickup.file.FilePickUpPlace -   - *** Pausing emissary.pickup.file.FileDataServer for emissary.pickup.file.FilePickUpPlace
2025-02-22T23:33:29.284 [localhost-8001] INFO  emissary.server.EmissaryServer -   - Waiting for server to drain
2025-02-22T23:33:33.732 [localhost-8001] INFO  emissary.core.Pausable -   - emissary.pickup.file.FileDataServer currently paused, sleeping for 60000
2025-02-22T23:33:34.294 [localhost-8001] INFO  emissary.place.RefreshableServiceProviderPlace -   - Place refresh performed successfully
2025-02-22T23:33:34.294 [localhost-8001] INFO  emissary.pickup.file.FilePickUpPlace -   - *** Unpausing emissary.pickup.file.FileDataServer for emissary.pickup.file.FilePickUpPlace

@dev-mlb dev-mlb changed the title Refresh srv prvd place Refresh IServiceProviderPlaces Feb 22, 2025
@dev-mlb dev-mlb force-pushed the refresh-srv-prvd-place branch from 93ee1f9 to 22628f3 Compare February 23, 2025 00:26
unpause();
} catch (Exception e) {
LOG.error("There was an error trying to refresh services, shutting down!!", e);
stopServer();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe a little aggressive??

private static void waitForAgentsToDrain() throws NamespaceException, TimeoutException {
long agentCount;
try {
long timeout = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(30);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to make this configurable

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

Successfully merging this pull request may close these issues.

1 participant