Skip to content

Fix build execute - in some cases one build executed with many process#51

Merged
corpsee merged 3 commits into
php-censor:masterfrom
ss-gxp:fix-builder
Apr 5, 2017
Merged

Fix build execute - in some cases one build executed with many process#51
corpsee merged 3 commits into
php-censor:masterfrom
ss-gxp:fix-builder

Conversation

@ss-gxp

@ss-gxp ss-gxp commented Apr 4, 2017

Copy link
Copy Markdown
Member

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.

@corpsee

corpsee commented Apr 5, 2017

Copy link
Copy Markdown
Member

Thanks! I will try to review and test on the worker soon.

Comment thread src/PHPCensor/Worker/BuildWorker.php Outdated

@corpsee corpsee Apr 5, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/PHPCensor/Worker/BuildWorker.php Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $store is undefined

@ss-gxp

ss-gxp commented Apr 5, 2017

Copy link
Copy Markdown
Member Author

I corrected the name of the variable (I apologize, copy-paste).
And also found an older error with an attempt to continue working if the build was not found.
I still do not understand the reason:

all builds hangs in status Build::STATUS_RUNNING

Can you test again?

@corpsee

corpsee commented Apr 5, 2017

Copy link
Copy Markdown
Member

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.

@corpsee

corpsee commented Apr 5, 2017

Copy link
Copy Markdown
Member

Checked, the same story :(
build-log

@ss-gxp

ss-gxp commented Apr 5, 2017

Copy link
Copy Markdown
Member Author

If we are catching BuilderException, build hangs in N status and have not finish 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.
It is possible that the release of the job does not work correctly. Please, check again.

@corpsee

corpsee commented Apr 5, 2017

Copy link
Copy Markdown
Member

The problem is not this 😈
build-log-2

@ss-gxp

ss-gxp commented Apr 5, 2017

Copy link
Copy Markdown
Member Author

Installed benstalkd, and launched
beanstalkd -V
launched worker
./bin/console php-censor:worker > runtime/worker.log
Now I test build with success and with fail (exception and false statuses). Did not hangup.
How to reproduce the behavior you are talking about?

@corpsee

corpsee commented Apr 5, 2017

Copy link
Copy Markdown
Member

I don't know :(. May be problem in the daemon mode with supervisord. Anyway I will try to research what is happening.

@corpsee

corpsee commented Apr 5, 2017

Copy link
Copy Markdown
Member

It is working fine on another project! I found problem - #44. @ss-gxp Can you rebase your branch on fresh master?

@corpsee

corpsee commented Apr 5, 2017

Copy link
Copy Markdown
Member

Thanks.

@corpsee corpsee merged commit 0109e49 into php-censor:master Apr 5, 2017
@ss-gxp ss-gxp deleted the fix-builder branch April 5, 2017 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants