Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Ошибки при изменении статуса PR + предлагаемый фикс

Баринов Сергей March 7, 2018

не чистится таблица для dao

AoFileCoverage

В логах ошибки вида (Bitbucket Server, DB: Postgres):

c.a.s.i.e.AsyncBatchingInvokersTransformer There was an exception thrown trying to dispatch event 'com.atlassian.bitbucket.event.pull.PullRequestDeclinedEvent[source=com.atlassian.stash.internal.pull.DefaultPullRequestService@3e316076]' for the invoker 'SingleParameterMethodListenerInvoker{method=public void com.atlassian.stash.internal.notification.pullrequest.PullRequestNotificationProducer.onPullRequestClosed(com.atlassian.bitbucket.event.pull.PullRequestDeclinedEvent), listener=com.atlassian.stash.internal.notification.pullrequest.PullRequestNotificationProducer@10b5497c}'
java.lang.RuntimeException: An error occurred while executing an external process: ERROR: cannot execute DELETE in a read-only transaction. Listener: com.atlassian.stash.internal.notification.pullrequest.PullRequestNotificationProducer event: com.atlassian.bitbucket.event.pull.PullRequestDeclinedEvent

 Происходит это при отработке метода AoCodeCoverageDao.deleteCoverageForCommit. Вероятно, ошибка в реализации ActiveObjects.deleteWithSQL в случае использования Postgress

workaround: отказаться от использования метода ActiveObjects.deleteWithSQL, использовать вместо него delete, например (класс AoCodeCoverageDao):

public int deleteCoverageForCommit(String commitId) {
AoFileCoverage[] items = ao.find(AoFileCoverage.class,ID_QUERY,commitId);
ao.delete(items);
log.info("{} coverage entries were deleted for commit {}", items.length, commitId);
return items.length;
}

В таком варианте работает 

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events