lhotari commented on pull request #11370:
URL: https://github.com/apache/pulsar/pull/11370#issuecomment-882448712


   I also took a look at the test. There's a problem in the RackAwareTest 
itself in setup and cleanup.
   
   These are the required changes for fixing setup and cleaup:
   ```
   public class RackAwareTest extends BkEnsemblesTestBase {
   
       private static final int NUM_BOOKIES = 6;
       private final List<BookieServer> bookies = new ArrayList<>();
   
       public RackAwareTest() {
           // Start bookies manually
           super(0);
       }
   
       @Override
       protected void configurePulsar(ServiceConfiguration config) throws 
Exception {
           // Start bookies with specific racks
           for (int i = 0; i < NUM_BOOKIES; i++) {
               File bkDataDir = Files.createTempDirectory("bk" + 
Integer.toString(i) + "test").toFile();
               ServerConfiguration conf = new ServerConfiguration();
   
               conf.setBookiePort(0);
               conf.setZkServers("127.0.0.1:" + bkEnsemble.getZookeeperPort());
               conf.setJournalDirName(bkDataDir.getPath());
               conf.setLedgerDirNames(new String[] { bkDataDir.getPath() });
               conf.setAllowLoopback(true);
   
               // Use different advertised addresses for each bookie, so we can 
place them in different
               // racks.
               // Eg: 1st bookie will be 10.0.0.1, 2nd 10.0.0.2 and so on
               String addr = String.format("10.0.0.%d", i + 1);
               conf.setAdvertisedAddress(addr);
   
               BookieServer bs = new BookieServer(conf, 
NullStatsLogger.INSTANCE, null);
   
               bs.start();
               bookies.add(bs);
           }
       }
   
       @Override
       protected void cleanup() throws Exception {
           super.cleanup();
   
           for (BookieServer bs : bookies) {
               bs.shutdown();
           }
   
           bookies.clear();
       }
   ```
   
   (also adding `throws Exception` to `configurePulsar`)
   
   With these changes, the test goes into a deadlock. There's some change in 
Zookeeper caching that seems to trigger the problem. It's probably caused [by 
the PIP-45 changes](https://github.com/apache/pulsar/pulls?q=is%3Apr+PIP-45). 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to