mirror of
				https://github.com/minio/minio.git
				synced 2025-10-29 15:55:00 -04:00 
			
		
		
		
	crawler: Wait max 1 second (#9894)
Add 1-second timeout to crawler wait. This will make the crawler able to run, albeit very, very slowly on high load servers.
This commit is contained in:
		
							parent
							
								
									f706a5b4c8
								
							
						
					
					
						commit
						cae09d8b84
					
				| @ -60,8 +60,10 @@ const ( | ||||
| 	readAheadBufSize = 1 << 20 | ||||
| 
 | ||||
| 	// Wait interval to check if active IO count is low | ||||
| 	// to proceed crawling to compute data usage | ||||
| 	// to proceed crawling to compute data usage. | ||||
| 	// Wait up to lowActiveIOWaitMaxN times. | ||||
| 	lowActiveIOWaitTick = 100 * time.Millisecond | ||||
| 	lowActiveIOWaitMaxN = 10 | ||||
| 
 | ||||
| 	// XL metadata file carries per object metadata. | ||||
| 	xlStorageFormatFile = "xl.meta" | ||||
| @ -357,8 +359,16 @@ func (s *xlStorage) IsLocal() bool { | ||||
| } | ||||
| 
 | ||||
| func (s *xlStorage) waitForLowActiveIO() { | ||||
| 	max := lowActiveIOWaitMaxN | ||||
| 	for atomic.LoadInt32(&s.activeIOCount) >= s.maxActiveIOCount { | ||||
| 		time.Sleep(lowActiveIOWaitTick) | ||||
| 		max-- | ||||
| 		if max == 0 { | ||||
| 			if intDataUpdateTracker.debug { | ||||
| 				logger.Info("waitForLowActiveIO: waited %d times, resuming", lowActiveIOWaitMaxN) | ||||
| 			} | ||||
| 			break | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user