Bug 24993

Summary: koha-sip --restart is too fast, doesn't always start SIP
Product: Koha Reporter: Liz Rea <wizzyrea>
Component: SIP2Assignee: Liz Rea <wizzyrea>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: 1joynelson, colin.campbell, jonathan.druart, lucas, wizzyrea
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24991
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11
Circulation function:
Attachments: Bug 24993: add a pause between stopping and starting sip on restart
Bug 24993: add a pause between stopping and starting sip on restart
[ALTERNATIVE-PATCH] Bug 24993: Make sure SIP server is stopped before restarting it
Bug 24993: Make sure we are not going to loop indefinitely
Bug 24993: fix increment
Bug 24993: fix increment
Attachment to Bug 24993 - koha-sip --restart is too fast, doesn't always start sip
Attachment to Bug 24993 - koha-sip --restart is too fast, doesn't always start sip
Bug 24993: Make sure SIP server is stopped before restarting it
Bug 24993: Make sure we are not going to loop indefinitely
Bug 24993: fix increment
Bug 24993: Make sure SIP server is stopped before restarting it
Bug 24993: Make sure we are not going to loop indefinitely
Bug 24993: fix increment

Description Liz Rea 2020-03-26 15:20:45 UTC
Sometimes doing koha-sip --restart inst happens too fast and start sip doesn't start it. A pause in there to let SIP catch up would probably fix it.
Comment 1 Liz Rea 2020-03-26 15:32:18 UTC
Created attachment 101876 [details] [review]
Bug 24993: add a pause between stopping and starting sip on restart

To test:

- have SIP enabled and running
- issue a restart, make sure it restarts.
 sudo koha-sip --restart inst
Comment 2 David Nind 2020-04-02 01:22:19 UTC
Created attachment 102255 [details] [review]
Bug 24993: add a pause between stopping and starting sip on restart

To test:

- have SIP enabled and running
- issue a restart, make sure it restarts.
 sudo koha-sip --restart inst

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Jonathan Druart 2020-04-02 10:36:49 UTC
Created attachment 102280 [details] [review]
[ALTERNATIVE-PATCH] Bug 24993: Make sure SIP server is stopped before restarting it
Comment 4 Jonathan Druart 2020-04-02 10:38:27 UTC
Hi Liz, what about this patch?

I think "sleeping 3" is too arbitrary.
We may need to add a max number of iterations to avoid looping forever (in case something went wrong).
Comment 6 Liz Rea 2020-04-08 03:13:43 UTC
I don't know that I have an opinion about this, if you think your way is better I'll sign off on that. I do like the idea of a limit, if we have to do it this way.
Comment 7 Jonathan Druart 2020-04-08 09:57:31 UTC
Created attachment 102546 [details] [review]
Bug 24993: Make sure we are not going to loop indefinitely
Comment 8 Liz Rea 2020-04-09 15:45:27 UTC
Hi Jonathan,

I just tested this in my devbox, I'd get into the loop but every test I did, sip didn't get started after it stopped.

I'll try to troubleshoot it but if you can immediately see what's wrong, happy for a fix.

Cheers,
Liz
Comment 9 Liz Rea 2020-04-09 15:52:10 UTC
Created attachment 102648 [details] [review]
Bug 24993: fix increment

Aparently ((i++)) isn't portable, changed for an admittedly uglier
but functional increment.
Comment 10 Jonathan Druart 2020-04-10 08:41:34 UTC
Created attachment 102682 [details] [review]
Bug 24993: fix increment

Aparently ((i++)) isn't portable, changed for an admittedly uglier
but functional increment.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Liz Rea 2020-04-10 18:00:25 UTC
Created attachment 102752 [details] [review]
Attachment to Bug 24993 - koha-sip --restart is too fast, doesn't always start sip

Bug 24993: Make sure SIP server is stopped before restarting it

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 12 Liz Rea 2020-04-10 18:09:35 UTC
Created attachment 102753 [details] [review]
Attachment to Bug 24993 - koha-sip --restart is too fast, doesn't always start sip

Bug 24993: Make sure SIP server is stopped before restarting it

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 13 Liz Rea 2020-04-10 18:19:57 UTC
Created attachment 102754 [details] [review]
Bug 24993: Make sure SIP server is stopped before restarting it

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 14 Liz Rea 2020-04-10 18:20:06 UTC
Created attachment 102755 [details] [review]
Bug 24993: Make sure we are not going to loop indefinitely

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 15 Liz Rea 2020-04-10 18:20:09 UTC
Created attachment 102756 [details] [review]
Bug 24993: fix increment

Aparently ((i++)) isn't portable, changed for an admittedly uglier
but functional increment.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 16 Katrin Fischer 2020-04-12 19:01:14 UTC
The latest iteration of these patches is missing test plans and descriptions?

Can you remind me where I need to copy the files for testing with kohadevbox?
Comment 17 Jonathan Druart 2020-04-13 09:17:34 UTC
The test plan is the same as the original one.
You need to restart the SIP server using koha-sip --restart, and makes sure is has been restarted (without this patch, it does not always).

you can `reset_all` (which will call cp_debian_files.pl from misc4dev), or simply copy it to /usr/sbin/koha-sip (`which koha-sip` helps you to find it).
Comment 18 Katrin Fischer 2020-04-13 11:55:57 UTC
(In reply to Jonathan Druart from comment #17)
> The test plan is the same as the original one.

I was referring to the fact, that there is nothing in the commit messages now, also it seems to have been there in early iterations? I'll readd it, but it's extra work I'd like to avoid :)

> You need to restart the SIP server using koha-sip --restart, and makes sure
> is has been restarted (without this patch, it does not always).
> 
> you can `reset_all` (which will call cp_debian_files.pl from misc4dev), or
> simply copy it to /usr/sbin/koha-sip (`which koha-sip` helps you to find it).

Thx, exactly what I needed to know!
Comment 19 Katrin Fischer 2020-04-13 12:06:08 UTC
Created attachment 102823 [details] [review]
Bug 24993: Make sure SIP server is stopped before restarting it

Sometimes doing koha-sip --restart instance happens too fast and
the SIP server is not started.

To test:
- have SIP enabled and running for your instance
- issue a restart, make sure it restarts
  sudo koha-sip --restart inst

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 Katrin Fischer 2020-04-13 12:06:11 UTC
Created attachment 102824 [details] [review]
Bug 24993: Make sure we are not going to loop indefinitely

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 21 Katrin Fischer 2020-04-13 12:06:15 UTC
Created attachment 102825 [details] [review]
Bug 24993: fix increment

Aparently ((i++)) isn't portable, changed for an admittedly uglier
but functional increment.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 22 Martin Renvoize (ashimema) 2020-04-14 07:37:10 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 23 Joy Nelson 2020-05-05 21:09:25 UTC
backported to 19.11.x for 19.11.06
Comment 24 Lucas Gass (lukeg) 2020-05-13 22:12:31 UTC
backported to 19.05.x for 19.05.11