mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Check for context exceeded in WalkGitLog (#17319)
There is a slight race in checking of a context deadline exceed in #16467 which leads to a 500 on the repository page. The solution is to check the error coming back from `*LogNameStatusRepoParser.Next()` and if it is the `ContextDeadlineExceeded` break from the loop. Fix #17314 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -350,6 +350,9 @@ heaploop:
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		current, err := g.Next(treepath, path2idx, changed, maxpathlen)
 | 
							current, err := g.Next(treepath, path2idx, changed, maxpathlen)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
 | 
								if err == context.DeadlineExceeded {
 | 
				
			||||||
 | 
									break heaploop
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			g.Close()
 | 
								g.Close()
 | 
				
			||||||
			return nil, err
 | 
								return nil, err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user