jvrao commented on a change in pull request #775: Tests wait for client to see
started bookie
URL: https://github.com/apache/bookkeeper/pull/775#discussion_r153620882
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookieWatcher.java
##########
@@ -138,17 +142,40 @@ private synchronized void
processReadOnlyBookiesChanged(Set<BookieSocketAddress>
*
* @throws BKException when failed to read bookies
*/
- public void readBookiesBlocking() throws BKException {
- this.registrationClient.watchReadOnlyBookies(bookies ->
processReadOnlyBookiesChanged(bookies.getValue()));
- this.registrationClient.watchWritableBookies(bookies ->
processWritableBookiesChanged(bookies.getValue()));
+ public void initialBlockingBookieRead() throws BKException {
+ CompletableFuture<?> writable;
+ CompletableFuture<?> readonly;
+ synchronized (this) {
+ if (initialReadonlyBookiesFuture == null
+ && initialWritableBookiesFuture == null) {
Review comment:
Is it possible one of these is non-null? If so we need to handle that, if
not just check for one and assert on second.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services