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

Wait for all notifications to be processed #434

Closed
keith-turner opened this issue Mar 16, 2015 · 2 comments
Closed

Wait for all notifications to be processed #434

keith-turner opened this issue Mar 16, 2015 · 2 comments
Milestone

Comments

@keith-turner
Copy link
Contributor

While trying to completely automate running the stress test on the cluster, I realized I really need a fluo command line command to wait for all notifications to be processed. Scanning the notification locality groups is not good enough because of a race condition. The race conditions w/ simply scanning is that notifications not yet seen by the scan can cause notifications to be written behind the scan.

To check for this race condition I am thinking a wait command could do something like the following :

  while(true){
    int ts1 = oracle.allocateTimeStamp();
    int ntfyCount = countNotifications();
    int ts2 = oracle.allocateTimeStamp();
    if(ntfyCount == 0 && ts1 == (ts2 -1)){
      break;
    }
    int sleepTime = f(ntfyCount);
    sleep(sleepTime);
  }
@mikewalch
Copy link
Member

In the pseudo code, you recommend counting the number of outstanding notifications and sleeping a certain amount of time based off that number. Is there particular reason for doing this?

I am concerned it will be difficult to get the algorithm/calculation correct (and cause the wait command to sleep too long or too little). How about just checking periodically after a a certain number of seconds (set by the user) if there are notifications still available?

mikewalch added a commit to mikewalch/fluo that referenced this issue Apr 7, 2015
…ssed. Stop exceptions from being logged when OracleClient is closed
@keith-turner
Copy link
Contributor Author

Is there particular reason for doing this?

Was just thinking of avoiding scanning too much

I am concerned it will be difficult to get the algorithm/calculation correct

Should probably be

  int sleepTime = f(ntfyCount, numWorkers)

How about just checking periodically after a a certain number of seconds (set by the user)

I doubt the user would know what to put... I think we should make an attempt to figure something out or leave that option open for the future. Providing a user facing config option for that kinda locks us in to that, when I think the system can do things to figure out something reasonable.

mikewalch added a commit to mikewalch/fluo that referenced this issue Apr 7, 2015
…ssed. Stop exceptions from being logged when OracleClient is closed
mikewalch added a commit to mikewalch/fluo that referenced this issue Apr 8, 2015
mikewalch added a commit to mikewalch/fluo that referenced this issue Apr 8, 2015
mikewalch added a commit to mikewalch/fluo that referenced this issue Apr 9, 2015
mikewalch added a commit that referenced this issue Apr 9, 2015
Closes #434 #463 - Wait for all notifications to be processed.  Stop exc...
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

No branches or pull requests

2 participants