Skip to content

Conversation

vladak
Copy link
Member

@vladak vladak commented Jan 2, 2025

When mirroring a JDK project with unresponsive Mercurial parent, the opengrok-mirror command failed due to timeout which caused TypeError exception due to the status value being None:

processing of project 'jdk8' failed
  failed commands:
    'sudo -u wsmirror /opengrok/dist/bin/venv/bin/opengrok-mirror --api_timeout 16 --backupcount 120 --workers 3 --strip-outgoing -I -b -c /opengrok/etc/mirror-config.yml jdk8': 1
      multiprocessing.pool.RemoteTraceback:      """      Traceback (most recent call last):        
File "/usr/lib/python3.9/multiprocessing/pool.py", line 125, in worker        
  result = (True, func(*args, **kwds))        
File "/usr/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar        
  return list(map(*args))        
File "/opengrok/dist/bin/venv/lib/python3.9/site-packages/opengrok_tools/mirror.py", line 77, in worker        
  return mirror_project(config, project_name,        
File "/opengrok/dist/bin/venv/lib/python3.9/site-packages/opengrok_tools/utils/mirror.py", line 545, in mirror_project        
  r = process_outgoing(repos, project_name)        
File "/opengrok/dist/bin/venv/lib/python3.9/site-packages/opengrok_tools/utils/mirror.py", line 431, in process_outgoing        
  if repo.strip_outgoing():        
File "/opengrok/dist/bin/venv/lib/python3.9/site-packages/opengrok_tools/scm/mercurial.py", line 158, in strip_outgoing        
  if status > 0:      
TypeError: '>' not supported between instances of 'NoneType' and 'int'      """        
    The above exception was the direct cause of the following exception:        
    Traceback (most recent call last):        
File "/opengrok/dist/bin/venv/bin/opengrok-mirror", line 8, in <module>        
  sys.exit(main())        
File "/opengrok/dist/bin/venv/lib/python3.9/site-packages/opengrok_tools/mirror.py", line 227, in main        
  project_results = pool.map(worker, worker_args, 1)        
File "/usr/lib/python3.9/multiprocessing/pool.py", line 364, in map        
  return self._map_async(func, iterable, mapstar, chunksize).get()        
File "/usr/lib/python3.9/multiprocessing/pool.py", line 771, in get        
  raise self._value      TypeError: '>' not supported between instances of 'NoneType' and 'int'

This change fixes that.

@vladak vladak added the tools Python tools label Jan 2, 2025
@vladak vladak requested a review from kulikjak January 2, 2025 12:53
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 2, 2025
Copy link
Member

@kulikjak kulikjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vladak vladak merged commit 975ea6f into oracle:master Jan 2, 2025
9 checks passed
@vladak vladak deleted the tools_hg_outgoing_vs_timeout branch January 2, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement. tools Python tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants