#1357 errors in multicall can result in partial db changes
Closed: Fixed 4 years ago by mikem. Opened 4 years ago by mikem.

The multicall handler catches errors from individual calls and returns the error in the result rather than re-raising it. This sidesteps Koji's normal behavior of rolling back the transaction if an uncaught error occurs in the call.

This is unlikely to be a problem for most calls, but there are possible cases where a call could make multiple updates, hit an error partway through, and leave those partial updates in place.


Metadata Update from @mikem:
- Issue set to the milestone: 1.18
- Issue tagged with: bug

4 years ago

One example I found was adding a new tag with data in extra that is not json-encodeable. The call returns an error, but leaves a tag entry (sans extra).

d = datetime.datetime.now()
try:
    session.multicall = True
    session.createTag('my_bad_tag', extra={'date': d})
    session.multiCall(strict=True)
except Fault as e:
    logger.info('Got expected exception: %s', e)
else:
    logger.error('No exception')
taginfo = session.getTag('my_bad_tag')
if taginfo is not None:
    logger.error('Created bad tag: %r', taginfo)

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #1358 Merged 4 years ago