https://bz.apache.org/bugzilla/show_bug.cgi?id=66535

--- Comment #1 from Alex West <aw...@bossnine.com> ---
Although this may be 'intended' behavior, the code would lead me to believe
that the developers intended this to be a check on whether the file was 'valid'
and whether it had been 'idle' for some time.

I assume this because of the terminology used in the code, which uses a
function of isValid to call the check and even includes a reference to
timeIdle. Although as far as I can see there is nothing actually considered to
be 'idle' here. This is called by the main background process thread in its
loop. 

    public boolean isValid() {
        if (maxValidTime > 0) {
            long timeNow = System.currentTimeMillis();
            int timeIdle = (int) ((timeNow - creationTime) / 1000L);
            if (timeIdle > maxValidTime) {
                cleanup();
                if (file.exists() && !file.delete()) {
                    log.warn(sm.getString("fileMessageFactory.deleteFail",
file));
                }
                return false;
            }
        }
        return true;
    }

which is called by

    protected void removeInvalidFileFactories() {
        String[] fileNames = fileFactories.keySet().toArray(new String[0]);
        for (String fileName : fileNames) {
            FileMessageFactory factory = fileFactories.get(fileName);
            if (!factory.isValid()) {
                fileFactories.remove(fileName);
            }
        }
    }

which is called by

    public void backgroundProcess() {
        if (started) {
            if (watchEnabled) {
                count = (count + 1) % processDeployFrequency;
                if (count == 0) {
                    watcher.check();
                }
            }
            removeInvalidFileFactories();
        }

    }

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to