#vulnerable code 
                                boolean isCompactionComplete() {
        if (dbInternal.options.isCompactionDisabled())
            return true;

        if (compactionQueue.isEmpty()) {
            try {
                submitFileForCompaction(STOP_SIGNAL);
                compactionThread.join();
            } catch (InterruptedException e) {
                logger.error("Error in isCompactionComplete", e);
            }

            return true;
        }

        return false;
    } 
                            #location 8 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                CompactionManager(HaloDBInternal dbInternal) {
        this.dbInternal = dbInternal;
        this.compactionRateLimiter = RateLimiter.create(dbInternal.options.getCompactionJobRate());
        this.compactionQueue = new LinkedBlockingQueue<>();
    }