jenkinsci / jenkinsci/gitlab-branch-source-plugin
Status notification timeout
- Dominant language
- Java
- Stars
- 134
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes our pipeline freezes because the plugin gets a timeout when sending status notifications to GitLab. Our current solution is to try to resend the status message when it times out. Is it possible to add an option to increase the request timeout?
After some research, we think the timeout occurs in the following code section:
[GitLabPipelineStatusNotifier](https://github.com/jenkinsci/gitlab-branch-source-plugin/blob/master/src/main/java/io/jenkins/plugins/gitlabbranchsource/helpers/GitLabPipelineStatusNotifier.java)
```java
try {
GitLabApi gitLabApi = GitLabHelper.apiBuilder(source.getServerName());
LOGGER.log(Level.FINE, String.format("Notifiying commit: %s", hash));
if (revision instanceof MergeRequestSCMRevision) {
Integer projectId = getSourceProjectId(build.getParent(), gitLabApi, source.getProjectPath());
status.setRef(((MergeRequestSCMRevision) revision).getOrigin().getHead().getName());
gitLabApi.getCommitsApi().addCommitStatus(
projectId,
hash,
state,
status);
} else {
gitLabApi.getCommitsApi().addCommitStatus(
source.getProjectPath(),
hash,
state,
status);
}
listener.getLogger().format("[GitLab Pipeline Status] Notified%n");
} catch (GitLabApiException e) {
if(!e.getMessage().contains(("Cannot transition status"))) {
LOGGER.log(Level.WARNING, String.format("Exception caught: %s",e.getMessage()));
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.