Closed ntadas closed 8 years ago
I'm not able to reproduce the issue. What exactly is the content of the subscription message? I had
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"/>
</rpc>
and then I had a simple code (notif.c) to generate notifications:
#include <libnetconf.h>
int main(int argc, char *argv[])
{
nc_init(NC_INIT_SINGLELAYER | NC_INIT_NOTIF);
ncntf_event_new(-1, NCNTF_GENERIC, argv[1]);
nc_close();
return 0;
}
and the scenario was:
$ ./notif "<event>test1</event>"
$ ./notif "<event>test2</event>"
So, everything works as expected. Could you please test my scenario with the notif.c
? The only reason for the behaviour you are describing I see in some parameters of the subscription RPC that would make ncntf_dispatch_send()
sending the events from the past.
Maybe try to share more details about the notifications, what exactly (XML content including the time) does the client receive?
Hi,
so the subscription message seems ok, its:
`
`
I've tested as you asked (with the sample program) and I have what you describe in your answer (also what I mention to be the problem). in your point 9 you state that your receive notification test1 shouldn't you receive test2? if not then my behaviour is also ok, but I would expect to see test2?
Regards Nuno
I had a typo in point 9, I've received correctly test2
notification.
If you get test1
, then it is a bug, but I'm not able to reproduce it with netopeer-server. I have to think about it little more, we will see if I'll get some idea.
btw, I expect that you have only a single events file (NETCONF.events.
Yes I only using this one. On 10 Mar 2016 1:08 p.m., "Radek Krejčí" notifications@github.com wrote:
btw, I expect that you have only a single events file (NETCONF.events.) in your streams directory, right?
— Reply to this email directly or view it on GitHub https://github.com/CESNET/libnetconf/issues/170#issuecomment-194834454.
Maybe I'm missing some initialisation of the streams in my server? Do I have to do something special? On 10 Mar 2016 1:10 p.m., "Nuno Tadeu" nuno.tadeu@gmail.com wrote:
Yes I only using this one. On 10 Mar 2016 1:08 p.m., "Radek Krejčí" notifications@github.com wrote:
btw, I expect that you have only a single events file (NETCONF.events.) in your streams directory, right?
— Reply to this email directly or view it on GitHub https://github.com/CESNET/libnetconf/issues/170#issuecomment-194834454.
I believe that having NC_INIT_NOTIF
in nc_init()
's flags
parameter should be enough. The NETCONF stream as the default one should be initialized automatically.
strange thing is that I send a notification test1, but after I restart the server I don't see this test1 in the stream, but the client receives it, where can this informatio nbe stored beside the stream?
On Thu, Mar 10, 2016 at 2:14 PM, Radek Krejčí notifications@github.com wrote:
I believe that having NC_INIT_NOTIF in nc_init()'s flags parameter should be enough. The NETCONF stream as the default one should be initialized automatically.
— Reply to this email directly or view it on GitHub https://github.com/CESNET/libnetconf/issues/170#issuecomment-194863759.
What does mean that "you don't see the test1 in the stream". How do you see on notifications in the stream?
if I open the file ..../streams/NETCONF.events.
On Thu, Mar 10, 2016 at 2:21 PM, Radek Krejčí notifications@github.com wrote:
What does meant that "you don't see the test1 in the stream". How do you see on notifications in the stream?
— Reply to this email directly or view it on GitHub https://github.com/CESNET/libnetconf/issues/170#issuecomment-194869342.
before you kill the server, try to check which applications have open the events file:
$ sudo lsof /var/lib/libnetconf/streams/NETCONF.events.<number>
Anyway, it is really strange, because when you erase the events file and start the server, the server should
In your case, it seems that the server detects a new event, but reads from the erased (unlinked) file and send the event from the erased file.
found the problem, server is working as expected also netopeer-client, this is a problem of other client that I'm using. if I do the same test with 2 clients subscribing the notifications netopeer-cli will receive the correct notification but the other client will display a very old notification (so it seems to be some issue with the client). thanks for your time and sorry for this misunderstanding.
Regards Nuno
On Thu, Mar 10, 2016 at 2:40 PM, Radek Krejčí notifications@github.com wrote:
before you kill the server, try to check which applications have open the events file:
$ sudo lsof /var/lib/libnetconf/streams/NETCONF.events.
Anyway, it is really strange, because when you erase the events file and start the server, the server should
- create the missing empty events file
- open it and monitor for new events
- wheneve a new event is written into the file (by anyone), the server detects it, read a new event and send it to the client
In your case, it seems that the server detects a new event, but read it from the erased (unlinked) file and send the event from the erased file.
— Reply to this email directly or view it on GitHub https://github.com/CESNET/libnetconf/issues/170#issuecomment-194877643.
great, I was almost out of ideas :) Can you name the client to know that there is such a problem?
Hi,
The scenario I'm testing is the following: 1- I start my server (everything is clean). 2- connect a client and subscribe it to receive notifications 3- generate notifications A, B and C 4- kill the server and start it again (without touching the working dir). 5- connect a client and subscribe it to receive notifications 6- generate notifications D e and F 7- client receives notifcations A B and C
I'm using the method ncntf_event_new(-1, NCNTF_GENERIC, notifString) to send the notifications and the ncntf_dispatch_send(sessionId, subscriptionRpc); to dispatch them.
Regards Nuno