Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Revert "retry rtiddsgen(_server) invocation if it fails with a return…
Browse files Browse the repository at this point in the history
… code (#38)"

This reverts commit a98335b.

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
  • Loading branch information
dirk-thomas committed Dec 4, 2019
1 parent ae1fe62 commit 6cccf97
Showing 1 changed file with 12 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,19 @@ def generate_dds_connext_cpp(
count = 1
max_count = 5
while True:
try:
subprocess.check_call(cmd)
except subprocess.CalledProcessError as e:
# HACK(dirk-thomas) it seems that the RTI code generator
# sometimes fails when running in highly conconcurrent
# environments therefore we will just retry the invocation
print("'%s' failed for '%s/%s' with rc %d" %
(idl_pp, pkg_name, msg_name, e.returncode),
file=sys.stderr)
# just another double check since frequently the RTI code
# generator reports that the input .idl file is missing
assert os.path.exists(idl_file), \
'Could not find IDL file: ' + idl_file
else:
# fail safe if the generator does not work as expected
any_missing = False
for suffix in ['.h', '.cxx', 'Plugin.h', 'Plugin.cxx', 'Support.h', 'Support.cxx']:
filename = os.path.join(output_path, msg_name + suffix)
if not os.path.exists(filename):
any_missing = True
break
if not any_missing:
subprocess.check_call(cmd)

# fail safe if the generator does not work as expected
any_missing = False
for suffix in ['.h', '.cxx', 'Plugin.h', 'Plugin.cxx', 'Support.h', 'Support.cxx']:
filename = os.path.join(output_path, msg_name + suffix)
if not os.path.exists(filename):
any_missing = True
break
print("'%s' failed to generate the expected files for '%s/%s'" %
(idl_pp, pkg_name, msg_name), file=sys.stderr)
if not any_missing:
break
print("'%s' failed to generate the expected files for '%s/%s'" %
(idl_pp, pkg_name, msg_name), file=sys.stderr)
if count < max_count:
count += 1
print('Running code generator again (retry %d of %d)...' %
Expand Down

0 comments on commit 6cccf97

Please sign in to comment.