TAJO-168: infinite loop occurs when QueryMaster is stopping. (jinho)