{"push_id":4270646526,"size":4,"distinct_size":4,"ref":"refs/heads/vatech-v19.05.04-04","head":"89d62a4f4e959be1017eb2bf2b3ba2b8c15e3827","before":"44c9400d1c2bc6e020bf81ee94b8267f32f58e26","commits":[{"sha":"f386eb4ea97d0e928dcfe4cc131bdad42d746f84","author":{"name":"Kyle M Hall","email":"3c25b01657254677d3e1a8fd1f0742c5d489bd39@bywatersolutions.com"},"message":"VATECH - Bug 20342: Fix table locking issue, progress bar not updating, and allow use of plack for Stage MARC Import\n\nHave you ever seen this error?\nDBD::mysql::st execute failed: Deadlock found when trying to get lock; try restarting transaction [for Statement \"INSERT INTO import_record_matches (import_record_id, candidate_match_id, score),\n\nHave you ever noticed your progress bar during stage for import jumps from 0% to 100% with no updates in between?\n\nWould you like stage-marc-import.pl to work under plack?\n\nIf you answered yes to any of the following questions, this bug is for you!\n\nDuring uploads of large records using matching rules, we were getting 'Failed to submit form' popups on the marc record importer.\n\nFirst, I noticed that the parent process of stage-marc-import.pl wasn't returning the job id via ajax until the child process had completed. This works fine for smaller files as they process fast. For large files ( and in particular when using matching rules ) the process takes *much* longer.\n\nIt appears that $.ajax will resubmit the form if it doesn't get a response back in a given time ( I would estimate that to be about 30 seconds or so ). This causes a *second* instance of stage-marc-import.pl to be run. So now we have two processes both running transactions on the same table for the same batch id. I believe this is what is causing the Deadlock.\n\nSo, the crux of the matter is that for whatever reason, the parent process will not output until the child process has gone away. Hours of research entailed. The final answer is that the child process must be detached from the parent process. I tried doing this via setsid() but it did not help. Finally, I found that using Net::Server::Daemonize did!\n\nAfter I had my solution, I decided to see if stage-marc-import.pl and background-job-progress.pl could now be run under plack, and it appears that they can!\n\nTest Plan:\n1) Apply this patch\n2) Update /etc/koha/apache-shared-intranet-plack.conf manually, comment\n   out the lines for stage-marc-import.pl and  background-job-progress.pl\n3) Restart apache, plack and memcached\n4) Stage a large record in stage-marc-import.pl, use a matching rule\n5) Note it works!","distinct":true,"url":"https://api.github.com/repos/bywatersolutions/bywater-koha/commits/f386eb4ea97d0e928dcfe4cc131bdad42d746f84"},{"sha":"a887cfbd2e5f825268cfe91607ccc8433a015c0c","author":{"name":"Kyle M Hall","email":"3c25b01657254677d3e1a8fd1f0742c5d489bd39@bywatetsolutions.com"},"message":"VATECH - Bug 20342: Use File::Temp to get temp dir","distinct":true,"url":"https://api.github.com/repos/bywatersolutions/bywater-koha/commits/a887cfbd2e5f825268cfe91607ccc8433a015c0c"},{"sha":"c2f5b0923a300bb8bcf5cdf5732529dbb0ab38a6","author":{"name":"Kyle M Hall","email":"3c25b01657254677d3e1a8fd1f0742c5d489bd39@bywatetsolutions.com"},"message":"VATECH - Temporary fix in authenticate_api_request","distinct":true,"url":"https://api.github.com/repos/bywatersolutions/bywater-koha/commits/c2f5b0923a300bb8bcf5cdf5732529dbb0ab38a6"},{"sha":"89d62a4f4e959be1017eb2bf2b3ba2b8c15e3827","author":{"name":"Kyle M Hall","email":"3c25b01657254677d3e1a8fd1f0742c5d489bd39@bywatersolutions.com"},"message":"VATECH - Set bwsbranch to vatech-v19.05.04-04","distinct":true,"url":"https://api.github.com/repos/bywatersolutions/bywater-koha/commits/89d62a4f4e959be1017eb2bf2b3ba2b8c15e3827"}]}
{"actor":{"display_login":"kylemhall"}}