0

Thread from where the method gets called warmStandbyModeUtil.getWarmStandbyMode()

    public void executeJob(JobExecutionContext context) throws JobExecutionException {
        ApplicationContext applicationContext = SpringSupport.getApplicationContext();

        //No need to generate notifications from a standby server
        if (warmStandbyModeUtil.getWarmStandbyMode() == WarmStandbyModeUtil.WarmStandByMode.ACTIVE
                && context != null) {
            try {
                NotificationService esmNotificationService = (NotificationService) applicationContext.getBean("notificationService");
                esmNotificationService.processNotifications();
            } catch (Exception e) {
                LOGGER.error("Error occurred in notification dispatch job: " + e.getMessage());
            }
        }
    }

The actual code where the issue is happening

public WarmStandByMode getWarmStandbyMode() {
         String content = new String(Files.readAllBytes(Paths.get(nwNodeModeFile)));
}

Stacktrace:

INFO   | jvm 1    | 2022/09/07 14:30:02 | 14:30:02.748 [scheduler_Worker-1] ERROR com.rsa.smc.esm.core.utils.WarmStandbyModeUtil - failed to read /etc/netwitness/platform/nw-node-mode
INFO   | jvm 1    | 2022/09/07 14:30:02 | java.nio.file.FileSystemException: /etc/netwitness/platform/nw-node-mode: Too many open files
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at java.base/java.nio.file.Files.newByteChannel(Files.java:371)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at java.base/java.nio.file.Files.newByteChannel(Files.java  :422)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at java.base/java.nio.file.Files.readAllBytes(Files.java:3206)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at com.rsa.smc.esm.core.utils.WarmStandbyModeUtil.getWarmStandbyMode(WarmStandbyModeUtil.java:38)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at com.rsa.smc.esm.core.jobs.NotificationDispatchJob.executeJob(NotificationDispatchJob.java:27)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at com.rsa.netwitness.carlos.scheduling.jobs.AbstractJob.execute(AbstractJob.java:61)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
INFO   | jvm 1    | 2022/09/07 14:30:02 |   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

The file only contains one word "active" or "standby"

Vaibhav Singh
  • 177
  • 10
  • 1
    When you have too many open files, it’s a sign for code not closing files. Unfortunately, the problematic code is not the code that stumbled over the problem. – Holger Sep 13 '22 at 10:32

0 Answers0