Bug 24993 - koha-sip --restart is too fast, doesn't always start SIP
Summary: koha-sip --restart is too fast, doesn't always start SIP
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Liz Rea
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-26 15:20 UTC by Liz Rea
Modified: 2020-05-13 22:12 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11


Attachments
Bug 24993: add a pause between stopping and starting sip on restart (830 bytes, patch)
2020-03-26 15:32 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24993: add a pause between stopping and starting sip on restart (879 bytes, patch)
2020-04-02 01:22 UTC, David Nind
Details | Diff | Splinter Review
[ALTERNATIVE-PATCH] Bug 24993: Make sure SIP server is stopped before restarting it (805 bytes, patch)
2020-04-02 10:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24993: Make sure we are not going to loop indefinitely (901 bytes, patch)
2020-04-08 09:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24993: fix increment (768 bytes, patch)
2020-04-09 15:52 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24993: fix increment (842 bytes, patch)
2020-04-10 08:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Attachment to Bug 24993 - koha-sip --restart is too fast, doesn't always start sip (849 bytes, patch)
2020-04-10 18:00 UTC, Liz Rea
Details | Diff | Splinter Review
Attachment to Bug 24993 - koha-sip --restart is too fast, doesn't always start sip (849 bytes, patch)
2020-04-10 18:09 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24993: Make sure SIP server is stopped before restarting it (849 bytes, patch)
2020-04-10 18:19 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24993: Make sure we are not going to loop indefinitely (945 bytes, patch)
2020-04-10 18:20 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24993: fix increment (887 bytes, patch)
2020-04-10 18:20 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 24993: Make sure SIP server is stopped before restarting it (1.11 KB, patch)
2020-04-13 12:06 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24993: Make sure we are not going to loop indefinitely (1003 bytes, patch)
2020-04-13 12:06 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 24993: fix increment (945 bytes, patch)
2020-04-13 12:06 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 2020-05-13 22:12:31 UTC
backported to 19.05.x for 19.05.11