Fix build execute - in some cases one build executed with many process#51
Conversation
|
Thanks! I will try to review and test on the worker soon. |
There was a problem hiding this comment.
I started 4 builds and all builds hangs in status Build::STATUS_RUNNING with message 'Can`t build - status is not pending' in the middle of build log.
|
I corrected the name of the variable (I apologize, copy-paste).
Can you test again? |
|
In addition to this error (all builds hangs in status Build::STATUS_RUNNING) we have strange behavior: If we are catching BuilderException, build hangs in N status and have finished never. |
This is not a strange behavior, if the build is in running status, you do not need to run again. Because It's in the status of execution, a worker change it status, but for some reason does not finish. The question is why. |
|
Installed benstalkd, and launched |
|
I don't know :(. May be problem in the daemon mode with supervisord. Anyway I will try to research what is happening. |
|
Thanks. |


This fix is mainly for run builds with crontab. But probably this can be useful for run builds with workers.
Ideally, need rewrite the build execution code with lock, check process id, etc.
This fix use sql update status with condition to prevent concurrent processes acquire same build (I saw up to 5 parallel executions one build - if build execution time bigger than crontab schedule period). Also an attempt to correct the wrong work with the loggers in case of failures (the release of the build log was not performed). And the wrong check for the running build of a project.
It is necessary to test the build with workers.