cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
571
Views
0
Helpful
3
Replies

Notification.read is throwing end of file excption after calling syncHaNotification() in using NOTIF_HA_INFO_SYNC

prudrava
Cisco Employee
Cisco Employee

Notification.read is throwing end of file excption after calling syncHaNotification() in using NOTIF_HA_INFO_SYNC

without this NOTIF_HA_INFO_SYNC flag  it's working fine.

Getting below exception  --

com.tailf.conf.ConfException: unexpected end of file
        at com.tailf.conf.ConfInternal.readFill(ConfInternal.java:415)
        at com.tailf.conf.ConfInternal.termRead(ConfInternal.java:185)
        at com.tailf.conf.ConfInternal.termRead(ConfInternal.java:113)
        at com.tailf.notif.Notif.read(Notif.java:478)
        at com.example.haframework.notif.HANotificationListner.run(HANotificationListner.java:24)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.EOFException
        ... 6 more
Code Snippet:

Socket notifSock = new Socket("localhost", NcsMain.getInstance().getNcsPort());             

                EnumSet<NotificationType> notifSet = EnumSet.of(NotificationType.NOTIF_HA_INFO,

                                NotificationType.NOTIF_HA_INFO_SYNC);

                Notif haNotif = new Notif(notifSock, notifSet);

                // forever

                while (shouldRun) {

                        Notification notif = haNotif.read();

                        if (notif instanceof HaNotification) {

                                LOG.debug(notif.toString());

                                handleHaNotification((HaNotification)notif);

                        }

                }

3 Replies 3

Dan.Sullivan
Cisco Employee
Cisco Employee

You will probably need to open  a ticket on this one.

-Dan

equinix
Level 1
Level 1

Any update on this? Hit the same issue on NSO 4.7.4.3

equinix
Level 1
Level 1

As per javadoc in that case need to call below method during handling of that notification.

   /**
     * If the received event from {@link #read()} was a
     * {@link HaNotification} which was subscribed using the
     * notification type {@link NotificationType#NOTIF_HA_INFO}
     * in combination with {@link NotificationType#NOTIF_HA_INFO_SYNC}
     * it is important that we call this function or else the
     * user session will hang indefinitely.
     *
     * @throws IOException
     */
    public synchronized void syncHaNotification() throws IOException {