pkgman: Suppress the erroneous "aborted: No Error" messages on no internet.
Here's what happens: * BPackageManager created a BRefreshRepositoryRequest with a BContext of an empty DecisionProvider and itself. * Since there is no internet access, the FetchFileJobs that the refresh class queued fail. Specifically, the first one does, but then as the subsequent ones depend on it, they are all aborted. * As some jobs were aborted, the StateListener is notified. * The state listener of course has the BPackageManager class as one of the listeners, and so calls it, because even though the handler methods of BRefreshRepositoryRequest, they are powerless to stop event propagation. * The BPackageManager's highest subclass' implementation gets called, which is of course pkgman's. * pkgman decides to DIE() upon receiving word that a job was aborted. There are thus four potential solutions to this issue: * Rewrite the package kit's event & job handling systems to not be so screwed up in terms of propagation. Seriously, there is way too much stuff that we send to the "user" in here, and as you can see, it can get *extremely* convoluted even for supposedly "simple" tasks. This is probably the best "long-term" solution; but obviously is far too involved for the present. * Only partially rework event handling; specifically in the SupportKit to allow JobStateListeners to stop further propagation. This is probably the best "medium-term" solution. * Do not pass the package manager as the JobStateListener to the RefreshRepositoryRequest. This would have the downside that the regular notifications about download state, etc. would not be returned at all, which we don't want. We could make a shim ... but that would be a lot of code for little benefit. The prior solution makes more sense. * Completely ignore "JobAborted" notices in pkgman. In fact, this is the solution that virtually all other consumers of this API take (although some of them seem to have TODOs about it), including package_daemon, HaikuDepot, etc., and so it's the one I've taken here. If a "job aborted" error is actually fatal, then it's the Package Kit's problem. Fixes #13075.
This commit is contained in:
parent
4c7002a3d1
commit
21e99b4766
@ -69,13 +69,6 @@ PackageManager::JobFailed(BSupportKit::BJob* job)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PackageManager::JobAborted(BSupportKit::BJob* job)
|
||||
{
|
||||
DIE(job->Result(), "aborted");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PackageManager::HandleProblems()
|
||||
{
|
||||
|
@ -32,7 +32,6 @@ public:
|
||||
void SetInteractive(bool interactive);
|
||||
|
||||
virtual void JobFailed(BSupportKit::BJob* job);
|
||||
virtual void JobAborted(BSupportKit::BJob* job);
|
||||
|
||||
private:
|
||||
// UserInteractionHandler
|
||||
|
Loading…
Reference in New Issue
Block a user