Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to send notification which has reference link #1650

Open
sukesh9995 opened this issue Oct 11, 2024 · 2 comments
Open

not able to send notification which has reference link #1650

sukesh9995 opened this issue Oct 11, 2024 · 2 comments
Labels
is:question Issue is actually a question.

Comments

@sukesh9995
Copy link

Hi @michalvasko

I am getting this error when I try send notification which has a reference link.

sr_notif_send_tree failed EV ORIGIN: SHM event "oper get" ID 3 processing timed out.
sr_notif_send_tree failed EV ORIGIN: SHM event "oper get" ID 4 processing timed out.

yang tree looks like this

notifications:
+---n download-event
| +--ro file-name string
| +--ro status? enumeration
| +--ro error-message? string
+---n install-event
| +--ro slot-name? -> /software-inventory/software-slot/name
| +--ro status? enumeration
| +--ro error-message? string
+---n activation-event
+--ro slot-name? -> /software-inventory/software-slot/name
+--ro status? enumeration
+--ro return-code? uint8
+--ro error-message? string

download-even notifications works fine but install-even and activation-event throws error.

this is how I am sending the notification.
sr_val_t *notif = calloc(1, 2 * sizeof(sr_val_t));
notif[0].xpath = "/o-ran-software-management:install-event/slot-name";
notif[0].type = SR_STRING_T;
notif[0].data.string_val = strdup("SLOT0");
notif[1].xpath = "/o-ran-software-management:install-event/status";
notif[1].type = SR_STRING_T;
notif[1].data.string_val = strdup("COMPLETED");

if(sr_notif_send(sess, "/o-ran-software-management:install-event", notif, 2, 0, 0) != SR_ERR_OK)
{
    sr_session_get_error(sess, &err_info);
    printf("sr_notif_send_tree failed %s\n", err_info->err[0].message);
}

Before sending notification I am doing a get operation on /software-inventory.

get --filter-xpath /software-inventory
DATA

SLOT0 VALID false false READ_WRITE SLOT1 VALID false false READ_WRITE SLOT2 VALID false false READ_WRITE SLOT3 VALID false false READ_WRITE

Please let me know why i am getting error while sending notification.

Regards,
Sukesh

@michalvasko
Copy link
Member

My guess is that you have a single thread (single subscriptions structure) handling both retrieving the state data and handling the notification. When you send the notification, these 2 events block each other and you get the timeout. Use 2 threads/subscription structures and it will work.

@michalvasko michalvasko added the is:question Issue is actually a question. label Oct 11, 2024
@sukesh9995
Copy link
Author

Thanks for the fast reply. Yes I am using single thread. Let me try 2 thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:question Issue is actually a question.
Projects
None yet
Development

No branches or pull requests

2 participants