diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-25 17:21:22 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-25 17:21:22 +0200 |
commit | 898f35f2982e86f95c7fe061aa5e697c771a0d47 (patch) | |
tree | 95425299b4c4668258707de9cc149ba6f43add10 /common/resourceaccess.h | |
parent | a9cd61f1baafe09fd20ffb6ba1c6728a8792b344 (diff) | |
download | sink-898f35f2982e86f95c7fe061aa5e697c771a0d47.tar.gz sink-898f35f2982e86f95c7fe061aa5e697c771a0d47.zip |
Avoid the socket probing and move the shutdown logic into
resourceaccess.
The problem was (as excercised by the last test in resourcecontroltest),
that in this scenario we would:
* trigger a synchronization that starts the resource, and then goes into
a loop trying to connecting (KAsync::wait -> singleshot timer)
* trigger a shutdown that would probe for the socket, not find it, and
thus do nothing.
* exit the testfunction, which somehow stops qtimer processing, meaning
we are stuck in KAsync::wait.
For now this is fixed by simply not probing for the socket.
Diffstat (limited to 'common/resourceaccess.h')
-rw-r--r-- | common/resourceaccess.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/resourceaccess.h b/common/resourceaccess.h index ea3329d..e791236 100644 --- a/common/resourceaccess.h +++ b/common/resourceaccess.h | |||
@@ -86,6 +86,11 @@ public: | |||
86 | return KAsync::null<void>(); | 86 | return KAsync::null<void>(); |
87 | } | 87 | } |
88 | 88 | ||
89 | virtual KAsync::Job<void> shutdown() | ||
90 | { | ||
91 | return KAsync::null<void>(); | ||
92 | } | ||
93 | |||
89 | int getResourceStatus() const | 94 | int getResourceStatus() const |
90 | { | 95 | { |
91 | return mResourceStatus; | 96 | return mResourceStatus; |
@@ -128,6 +133,7 @@ public: | |||
128 | sendInspectionCommand(int inspectionType,const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expecedValue) Q_DECL_OVERRIDE; | 133 | sendInspectionCommand(int inspectionType,const QByteArray &inspectionId, const QByteArray &domainType, const QByteArray &entityId, const QByteArray &property, const QVariant &expecedValue) Q_DECL_OVERRIDE; |
129 | KAsync::Job<void> sendFlushCommand(int flushType, const QByteArray &flushId) Q_DECL_OVERRIDE; | 134 | KAsync::Job<void> sendFlushCommand(int flushType, const QByteArray &flushId) Q_DECL_OVERRIDE; |
130 | KAsync::Job<void> sendSecret(const QString &secret) Q_DECL_OVERRIDE; | 135 | KAsync::Job<void> sendSecret(const QString &secret) Q_DECL_OVERRIDE; |
136 | KAsync::Job<void> shutdown() Q_DECL_OVERRIDE; | ||
131 | /** | 137 | /** |
132 | * Tries to connect to server, and returns a connected socket on success. | 138 | * Tries to connect to server, and returns a connected socket on success. |
133 | */ | 139 | */ |