Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email notification not sent when pipeline is cancelled due to reaching the job timeout #5370

Closed
aqneves opened this issue Nov 6, 2018 · 1 comment

Comments

Projects
4 participants
@aqneves
Copy link

commented Nov 6, 2018

Issue Type
  • Bug Report
Summary

Email notification not sent when pipeline is cancelled due to reaching the job timeout despite having subscribed all email notifications for that pipeline and having an email associated with the account. All other notifications are properly received.

Environment

Any environment.

Basic environment details
  • Go Version: 18.3.0
  • JAVA Version: 1.8.0_181
  • OS: RHEL 7.5
Additional Environment Details

n/a

Steps to Reproduce
  1. create pipeline X
  2. subscribe to all notifications of pipeline X
  3. configure a job for pipeline X that is a sleep of 2 minutes
  4. configure the job timeout to expire after 1 minute
  5. run the pipeline
Expected Results

We should be notified that the pipeline has started and then we should be notified that the pipeline was cancelled

Actual Results

Email notification for pipeline starting was received.
Email notification for pipeline cancelling was not received.

Possible Fix

n/a

Log snippets

n/a

Code snippets/Screenshots

n/a

Any other info

n/a

@adityasood adityasood added this to the Release 19.1.0 milestone Dec 4, 2018

GaneshSPatil added a commit to GaneshSPatil/gocd that referenced this issue Dec 5, 2018

Send an email notification when job is cancelled due to timeout (gocd…
…#5370)

Fix:
* Post a StageStatusTopic message when a job is completed regardless of the
 job state (passed, failed or cancelled).

Reason:
* StageStatusTopic was NOT invoked if the stage was not completed normally.
  A normal completion of the job involved only PASSED or FAILED stage state.
* Cancelled Stage due to timeout cancellation of a job scenario was missed
  while story implementation.

Older commit references (from cruise repo):
* 99dd349eefea4fb080b2c5146062207bfdcbda29
* 3ee6dc7cc125626565f46900cb51ffc4e0eaee66

@maheshp maheshp modified the milestones: Release 19.1.0, Release 18.12 Dec 6, 2018

@maheshp maheshp added this to To do in 18.12.0 via automation Dec 6, 2018

@maheshp maheshp moved this from To do to In progress in 18.12.0 Dec 6, 2018

GaneshSPatil added a commit to GaneshSPatil/gocd that referenced this issue Dec 6, 2018

Send an email notification when job is cancelled due to timeout (gocd…
…#5370)

* Post a StageResultMessage with Cancelled Stage event to StageResultTopic,
  EmailNotificationListener will send the email on a stageResultMessage.

GaneshSPatil added a commit to GaneshSPatil/gocd that referenced this issue Dec 7, 2018

Send an email notification when job is cancelled due to timeout (gocd…
…#5370)

Fix:
* Post a StageStatusTopic message when a job is completed regardless of the
 job state (passed, failed or cancelled).
* Do not explicitly post a StageStatusMessage when the job is cancelled by
  user. When a stage is cancelled, all jobs will be cancelled and
  JobStatusListener will send a StageStatusMessage on job completion.
  Eventually, a StageResultMessage will be sent when final job in the stage
  is cancelled. EmailNotificationListener listens to StageResultMessage,
  which will send the email when job is completely cancelled.

Reason:
* StageStatusTopic was NOT invoked if the stage was not completed normally.
  A normal completion of the job involved only PASSED or FAILED stage state.
* Cancelled Stage due to timeout cancellation of a job scenario was missed
  while story implementation.

Older commit references (from cruise repo):
* 99dd349eefea4fb080b2c5146062207bfdcbda29
* 3ee6dc7cc125626565f46900cb51ffc4e0eaee66

GaneshSPatil added a commit to GaneshSPatil/gocd that referenced this issue Dec 7, 2018

Send an email notification when job is cancelled due to timeout (gocd…
…#5370)

Fix:
* Post a StageStatusTopic message when a job is completed regardless of the
 job state (passed, failed or cancelled).
* Do not explicitly post a StageStatusMessage when the job is cancelled by
  user. When a stage is cancelled, all jobs will be cancelled and
  JobStatusListener will send a StageStatusMessage on job completion.
  Eventually, a StageResultMessage will be sent when final job in the stage
  is cancelled. EmailNotificationListener listens to StageResultMessage,
  which will send the email when job is completely cancelled.

Reason:
* StageStatusTopic was NOT invoked if the stage was not completed normally.
  A normal completion of the job involved only PASSED or FAILED stage state.
* Cancelled Stage due to timeout cancellation of a job scenario was missed
  while story implementation.

Older commit references (from cruise repo):
* 99dd349eefea4fb080b2c5146062207bfdcbda29
* 3ee6dc7cc125626565f46900cb51ffc4e0eaee66

GaneshSPatil added a commit to GaneshSPatil/gocd that referenced this issue Dec 12, 2018

Send an email notification when job is cancelled due to timeout (gocd…
…#5370)

Fix:
* Post a StageStatusTopic message when a job is completed regardless of the
 job state (passed, failed or cancelled).
* Explicitly post a StageStatusMessage when the job is cancelled by
  user and none of the jobs are assigned.

Who sends the email?:
	- When job is cancelled by GoCD, the JobStatusListener will send an
	  email notification.
	- When the stage is cancelled by user and at least one job is assigned
 	  to the agent, the JobStatusListener will send an email notification.
 	  As, JobStatusListener will be invoked for the assigned job, when
	  the state of the job changes to cancelled.
	- When the stage is cancelled by user and no jobs are assigned,
	  the StageService.CancelStage will send an email notification.
	  As, None of the jobs were scheduled, change in the jobs state from
	  scheduled to cancelled will not invoke the jobStatusListener.

Reason:
* StageStatusTopic was NOT invoked if the stage was not completed normally.
  A normal completion of the job involved only PASSED or FAILED stage state.
* Cancelled Stage due to timeout cancellation of a job scenario was missed
  while story implementation.

Older commit references (from cruise repo):
* 99dd349eefea4fb080b2c5146062207bfdcbda29
* 3ee6dc7cc125626565f46900cb51ffc4e0eaee66

GaneshSPatil added a commit to GaneshSPatil/gocd that referenced this issue Dec 13, 2018

Send an email notification when job is cancelled due to timeout (gocd…
…#5370)

Fix:
* Post a StageStatusTopic message when a job is completed regardless of the
 job state (passed, failed or cancelled).
* Explicitly post a StageStatusMessage when the job is cancelled by
  user and none of the jobs are assigned.

Who sends the email?:
	- When job is cancelled by GoCD, the JobStatusListener will send an
	  email notification.
	- When the stage is cancelled by user and at least one job is assigned
 	  to the agent, the JobStatusListener will send an email notification.
 	  As, JobStatusListener will be invoked for the assigned job, when
	  the state of the job changes to cancelled.
	- When the stage is cancelled by user and no jobs are assigned,
	  the StageService.CancelStage will send an email notification.
	  As, None of the jobs were scheduled, change in the jobs state from
	  scheduled to cancelled will not invoke the jobStatusListener.

Reason:
* StageStatusTopic was NOT invoked if the stage was not completed normally.
  A normal completion of the job involved only PASSED or FAILED stage state.
* Cancelled Stage due to timeout cancellation of a job scenario was missed
  while story implementation.

Older commit references (from cruise repo):
* 99dd349eefea4fb080b2c5146062207bfdcbda29
* 3ee6dc7cc125626565f46900cb51ffc4e0eaee66

GaneshSPatil added a commit that referenced this issue Dec 14, 2018

Send an email notification when job is cancelled due to timeout (#5370)…
… (#5506)

Fix:
* Post a StageStatusTopic message when a job is completed regardless of the
 job state (passed, failed or cancelled).
* Explicitly post a StageStatusMessage when the job is cancelled by
  user and none of the jobs are assigned.

Who sends the email?:
	- When job is cancelled by GoCD, the JobStatusListener will send an
	  email notification.
	- When the stage is cancelled by user and at least one job is assigned
 	  to the agent, the JobStatusListener will send an email notification.
 	  As, JobStatusListener will be invoked for the assigned job, when
	  the state of the job changes to cancelled.
	- When the stage is cancelled by user and no jobs are assigned,
	  the StageService.CancelStage will send an email notification.
	  As, None of the jobs were scheduled, change in the jobs state from
	  scheduled to cancelled will not invoke the jobStatusListener.

Reason:
* StageStatusTopic was NOT invoked if the stage was not completed normally.
  A normal completion of the job involved only PASSED or FAILED stage state.
* Cancelled Stage due to timeout cancellation of a job scenario was missed
  while story implementation.

Older commit references (from cruise repo):
* 99dd349eefea4fb080b2c5146062207bfdcbda29
* 3ee6dc7cc125626565f46900cb51ffc4e0eaee66

@GaneshSPatil GaneshSPatil moved this from In progress to Done in 18.12.0 Dec 17, 2018

@rajiesh rajiesh moved this from Done to QA Done in 18.12.0 Dec 17, 2018

@rajiesh

This comment has been minimized.

Copy link
Contributor

commented Dec 17, 2018

Verified on 18.12.0 (8203-bbeebad6c03497cf3f5bf0bcddbe13bbc08a11c8)

@rajiesh rajiesh closed this Dec 17, 2018

18.12.0 automation moved this from QA Done to Done Dec 17, 2018

@rajiesh rajiesh moved this from Done to QA Done in 18.12.0 Dec 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.