Since Plack mode (PSGI), the processes running with background jobs are broken. Bug 15218 corrected by using CGI mode for concerned pages. This patch proposes to allow running those pages in PSGI mode by disabling background jobs when PSGI is used.
Created attachment 55110 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode This adds prepares the main one by adding method "is_psgi" to C4::Context and using it in about.pl Test plan : - On a Koha running with Plack - Go to about.pl - Look at line "PGSI:" => You should see "Plack"
Created attachment 55111 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode - prepare This adds prepares the main one by adding method "is_psgi" to C4::Context and using it in about.pl Test plan : - On a Koha running with Plack - Go to about.pl - Look at line "PGSI:" => You should see "Plack"
Created attachment 55129 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode - prepare This adds prepares the main one by adding method "is_psgi" to C4::Context and using it in C4::Auth for all templates. It is used by about.pl and Koha::AuthUtils. Test plan : - On a Koha running with Plack - Go to about.pl - Look at line "PGSI:" => You should see "Plack" - Enable CAS authentication - Go to OPAC auth page - Look at the CAS link => You see the current page in this URL
Created attachment 55130 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode Since Plack mode (PSGI), the processes running with background jobs are broken. Bug 15218 corrected by using CGI mode for concerned pages. This patch proposes to allow running those pages in PSGI mode by disabling background jobs when PSGI is used. Script are running so faster with Plack, there are less chances that the process will end in HTTP timeout. Test plan : - on a Koha running with plack - revert Bug 15218 changes - test processes on pages : offline_circ/process_koc.pl tools/batchMod-edit.pl tools/batch_record_modification.pl tools/manage-marc-import.pl tools/stage-marc-import.pl tools/upload-images.pl
Created attachment 55137 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode - prepare This adds prepares the main one by adding method "is_psgi" to C4::Context and using it in C4::Auth for all templates. It is used by about.pl and Koha::AuthUtils. Test plan : - On a Koha running with Plack - Go to about.pl - Look at line "PGSI:" => You should see "Plack" - Enable CAS authentication - Go to OPAC auth page - Look at the CAS link => You see the current page in this URL
Created attachment 55138 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode Since Plack mode (PSGI), the processes running with background jobs are broken. Bug 15218 corrected by using CGI mode for concerned pages. This patch proposes to allow running those pages in PSGI mode by disabling background jobs when PSGI is used. Script are running so faster with Plack, there are less chances that the process will end in HTTP timeout. Test plan : - on a Koha running with plack - revert Bug 15218 changes - test processes on pages : offline_circ/process_koc.pl tools/batchMod-edit.pl tools/batch_record_modification.pl tools/manage-marc-import.pl tools/stage-marc-import.pl tools/upload-images.pl
Not sure it makes sense to disable the background mode. Did you try and edit 100k bibliographic records or items or patrons?
I don't agree with the proposed solution (we should make it work). But I love the first patch, it should have it's own bug, something like "Add C4::Context->is_psgi" in the title :-D
We should probably remove all fork calls. Resolve it with an ajax call (like the upload in one of these scripts) or via a queue serviced by some daemon. In general, it seems better to prevent starting jobs directly by the web interface.
(In reply to Jonathan Druart from comment #7) > Not sure it makes sense to disable the background mode. Did you try and edit > 100k bibliographic records or items or patrons? (In reply to Tomás Cohen Arazi from comment #8) > I don't agree with the proposed solution (we should make it work). But since in PSGI mode it is broken, why not make it work quickly ? A revamping may take a while.
Created attachment 55257 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode - followup Followup If not running in background mode, some calls are made on $job var.
Created attachment 58461 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode - followup 2 Followup 2 If not running in background mode, some calls are made on $job var in tools/batch_record_modification.pl.
I should split this into several bugs.
Created attachment 63291 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode - followup 3 Followup 3 If not running in background mode, items are not displayed in result page in tools/batchMod.pl.
Created attachment 63459 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode - followup 3 Followup 3 If not running in background mode, items are not displayed in result page in tools/batchMod.pl. Also the number of items and fields are missing in message.
Created attachment 63862 [details] [review] Bug 17240 - Allow processes that rely on background jobs run in Plack mode - followup 3 Followup 3 If not running in background mode, items are not displayed in result page in tools/batchMod.pl. Also the number of items and fields are missing in message.
Sounds like they are running under plack already, our apache2 config looks wrong With: ProxyPass "/cgi-bin/koha/tools/batch_record_modification.pl" "!" I see logs in plack log files With: ProxyPass "/intranet/tools/batch_record_modification.pl" "!" I see them in apache log files
Created attachment 76477 [details] [review] Bug 17240: (prepare) Allow processes that rely on background jobs run in Plack mode This adds prepares the main one by adding method "is_psgi" to C4::Context and using it in C4::Auth for all templates. It is used by about.pl and Koha::AuthUtils. Test plan : - On a Koha running with Plack - Go to about.pl - Look at line "PGSI:" => You should see "Plack" - Enable CAS authentication - Go to OPAC auth page - Look at the CAS link => You see the current page in this URL
Created attachment 76478 [details] [review] Bug 17240: Allow processes that rely on background jobs run in Plack mode Since Plack mode (PSGI), the processes running with background jobs are broken. Bug 15218 corrected by using CGI mode for concerned pages. This patch proposes to allow running those pages in PSGI mode by disabling background jobs when PSGI is used. Script are running so faster with Plack, there are less chances that the process will end in HTTP timeout. Test plan : - on a Koha running with plack - revert Bug 15218 changes - test processes on pages : offline_circ/process_koc.pl tools/batchMod-edit.pl tools/batch_record_modification.pl tools/manage-marc-import.pl tools/stage-marc-import.pl tools/upload-images.pl
Created attachment 76479 [details] [review] Bug 17240: (followup 1) Allow processes that rely on background jobs run in Plack mode Followup If not running in background mode, some calls are made on $job var.
Created attachment 76480 [details] [review] Bug 17240: (followup 2) Allow processes that rely on background jobs run in Plack mode Followup 2 If not running in background mode, some calls are made on $job var in tools/batch_record_modification.pl.
Created attachment 76481 [details] [review] Bug 17240: (followup 3) Allow processes that rely on background jobs run in Plack mode Followup 3 If not running in background mode, items are not displayed in result page in tools/batchMod.pl. Also the number of items and fields are missing in message.
Created attachment 76482 [details] [review] Bug 17240: (followup 4) Allow processes that rely on background jobs run in Plack mode Items batch deletion failed because after action, unlike batch modification, items are not displayed so code must not call BuildItemsData().
(In reply to Marcel de Rooy from comment #9) > We should probably remove all fork calls. Resolve it with an ajax call (like > the upload in one of these scripts) or via a queue serviced by some daemon. > In general, it seems better to prevent starting jobs directly by the web > interface. I totally agree.
Solved by Bug 22417 for example items edition Bug 28445