mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-29 22:49:41 +03:00 
			
		
		
		
	After a crash, don't restart workers with BGW_NEVER_RESTART.
Amit Khandekar
This commit is contained in:
		| @@ -419,9 +419,9 @@ BackgroundWorkerStopNotifications(pid_t pid) | |||||||
| /* | /* | ||||||
|  * Reset background worker crash state. |  * Reset background worker crash state. | ||||||
|  * |  * | ||||||
|  * We assume that, after a crash-and-restart cycle, background workers should |  * We assume that, after a crash-and-restart cycle, background workers without | ||||||
|  * be restarted immediately, instead of waiting for bgw_restart_time to |  * the never-restart flag should be restarted immediately, instead of waiting | ||||||
|  * elapse. |  * for bgw_restart_time to elapse. | ||||||
|  */ |  */ | ||||||
| void | void | ||||||
| ResetBackgroundWorkerCrashTimes(void) | ResetBackgroundWorkerCrashTimes(void) | ||||||
| @@ -433,6 +433,13 @@ ResetBackgroundWorkerCrashTimes(void) | |||||||
| 		RegisteredBgWorker *rw; | 		RegisteredBgWorker *rw; | ||||||
|  |  | ||||||
| 		rw = slist_container(RegisteredBgWorker, rw_lnode, iter.cur); | 		rw = slist_container(RegisteredBgWorker, rw_lnode, iter.cur); | ||||||
|  |  | ||||||
|  | 		/* | ||||||
|  | 		 * For workers that should not be restarted, we don't want to lose | ||||||
|  | 		 * the information that they have crashed; otherwise, they would be | ||||||
|  | 		 * restarted, which is wrong. | ||||||
|  | 		 */ | ||||||
|  | 		if (rw->rw_worker.bgw_restart_time != BGW_NEVER_RESTART) | ||||||
| 			rw->rw_crashed_at = 0; | 			rw->rw_crashed_at = 0; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user