Bug 374904 - Error cases of sub-jobs in MercurialPushJob and MercurialAnnotateJob not handled properly
Summary: Error cases of sub-jobs in MercurialPushJob and MercurialAnnotateJob not hand...
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: mercurial (show other bugs)
Version: git master
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: kdevelop-bugs-null
Depends on:
Reported: 2017-01-11 08:54 UTC by Frank Fischer
Modified: 2017-01-17 15:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Frank Fischer 2017-01-11 08:54:45 UTC
The signals `readyForParsing` as well as `resultsReady` of a DVcsJob might only be emitted if the process exits normally, i.e. if the process does not crash, if it exits with code 0 or if it exits with some code != 0 and DVcsJob::setIgnoreError(false) had been called (because of the implementation of DVcsJob::slotProcessExited). However, the class MercurialPushJob only connects to the signal `readyForParsing`, thus it may not recognize if one of the sub-jobs crashed/fails.

I suggest to connect to the signal `KJob::finished` in all cases to catch errors properly (and call MercurialPushJob::setFail() then).

I think the same problem exists in MercurialAnnotateJob.
Comment 1 Sergey Kalinichev 2017-01-17 15:46:40 UTC
Git commit 6fd88c79fd657034f872b331a399b45f07885c2d by Sergey Kalinichev.
Committed on 16/01/2017 at 18:10.
Pushed by vpuhov into branch 'master'.

Handle error cases of sub-jobs

Spotted by Frank Fischer

M  +40   -11   mercurialannotatejob.cpp
M  +14   -0    mercurialannotatejob.h
M  +5    -6    mercurialpushjob.cpp
M  +1    -1    mercurialpushjob.h
M  +22   -0    tests/test_mercurial.cpp
M  +1    -0    tests/test_mercurial.h