Feed Advanced Search

Jun 25 2023

KP_BETA added a comment to D10009: Improvements for Gettext entries wordwrapping.
Jun 25 2023, 8:20 PM
KP_ALPHA added a project to D10009: Improvements for Gettext entries wordwrapping: KASync.
Jun 25 2023, 7:26 PM

Dec 4 2020

cmollekopf closed T12493: serialEach broken in current master as Resolved.

Can't reproduce as of 338138c9d2007e75ebb7f5e97dc5894cb125193d.

Dec 4 2020, 7:19 PM · KASync

Jan 5 2020

cmollekopf assigned T12493: serialEach broken in current master to dvratil.
Jan 5 2020, 2:34 PM · KASync
cmollekopf triaged T12493: serialEach broken in current master as Normal priority.
Jan 5 2020, 2:34 PM · KASync

Dec 26 2019

cmollekopf added a comment to T12398: API v2.

A simple example without a value would be:

Dec 26 2019, 11:36 AM · KASync
cmollekopf added a comment to T12398: API v2.

I think we may even be able to used std::future and std::packaged_task directly, which I would prefer to another custom future/promise.

std::future does not have any state signalling, since it's all, so that might be a bit tricky. We still probably need a Qt-friendly wrapper to implement on top of std::future to provide some signal-slot interface and a FutureWatcher. std::packaged_task is an interesting idea, I will certainly look into it.

The error handler must forward/create the result matching what TASK3 expects.

You cannot create a result out of thin air. If the execution has failed, you simply do not have a result of the previous task.

Dec 26 2019, 11:26 AM · KASync
dvratil added a comment to T12398: API v2.

I think we may even be able to used std::future and std::packaged_task directly, which I would prefer to another custom future/promise.

Dec 26 2019, 11:19 AM · KASync
cmollekopf added a comment to T12398: API v2.

My idea is following:

  1. Introduce Promise and Future template classes, modeled after C++'s std::promise and std::future: The Promise is constructed first by the (a)synchronous task. It only has setter for result value (or error) and a getter to obtain a Future, which can the be returned from the task implementation back to KAsync to wait for a result/error. The Future and the Promise have a shared state (basically a shared pointer to a common private class that holds the result/error. It's possible to have multiple Futures created from the same Promise.

    The benefit is that it completely separates the lifetime of the Promise/Future from the Execution and rest of KAsync. This means that we no longer need to pass Future<T> & into every single task that should be asynchronous, cluttering the function's signature. Instead, the function indicates it is an asynchronous task by simply returning Future<T> instead of just T. Another benefit is that this Promise/Future API is more common in modern asynchronous frameworks.
Dec 26 2019, 10:26 AM · KASync

Dec 21 2019

dvratil added a comment to T12398: API v2.

My idea is following:

Dec 21 2019, 2:01 PM · KASync

Dec 20 2019

cmollekopf closed T12315: Crash with latest kasync master as Resolved.

Thanks that did the trick.

Dec 20 2019, 6:10 PM · KASync, Kube
cmollekopf triaged T12398: API v2 as Normal priority.
Dec 20 2019, 6:07 PM · KASync

Dec 19 2019

dvratil added a comment to T12315: Crash with latest kasync master.

OK, I have reverted the commit in master now. Sink tests pass again.

Dec 19 2019, 1:38 PM · KASync, Kube
cmollekopf added a comment to T12315: Crash with latest kasync master.

To be honest I think it makes most sense to revert back to default constructing T for the time being.

Dec 19 2019, 9:30 AM · KASync, Kube

Dec 18 2019

dvratil added a comment to T12315: Crash with latest kasync master.

There's no easy way how to fix this without reverting back to default-constructing T in Future<T>::Future().

Dec 18 2019, 1:30 PM · KASync, Kube
dvratil added a comment to T12315: Crash with latest kasync master.

It's not exactly the lifetime- it's a more deep-rooted issue with error handling.

Dec 18 2019, 9:58 AM · KASync, Kube

Dec 17 2019

cmollekopf added a comment to T12315: Crash with latest kasync master.

Generally, I'm wondering if I should deprecate this API and introduce a promise-future based API, where, instead of being passed a future from KAsync, the continuation would construct a Promise object internally a return a Future that KAsync would wait for....internally the continuation would own the Promise - it's closer to the common promise-future pattern and solves the lifetime issue, since the Promise is owned by the continuation, rather than by KAsync (which only holds the Future).

Dec 17 2019, 3:48 PM · KASync, Kube
cmollekopf added a comment to T12315: Crash with latest kasync master.

Hmm, I believe the bug might be in the Sink code. Here specifically, it's ResourceControl::flush():

The function registers two callbacks, both operating on the future reference. When the resource crashes (happens to me, I don't know if it's part of th etest), then sendFlushCommand fails, so future.setError is called (line 111). However, around the same time a notification is received with information about the crashed resource, invoking the lambda passed to registerHandler function, which then also calls future.setError() (line 98) - depending on which happens first, the future is finished at that point and completes the execution, which may delete the Future object, leaving the other lambda with a dangling reference....

Dec 17 2019, 3:42 PM · KASync, Kube
dvratil added a comment to T12315: Crash with latest kasync master.

Generally, I'm wondering if I should deprecate this API and introduce a promise-future based API, where, instead of being passed a future from KAsync, the continuation would construct a Promise object internally a return a Future that KAsync would wait for....internally the continuation would own the Promise - it's closer to the common promise-future pattern and solves the lifetime issue, since the Promise is owned by the continuation, rather than by KAsync (which only holds the Future).

Dec 17 2019, 2:39 PM · KASync, Kube
dvratil added a comment to T12315: Crash with latest kasync master.

I can probably solve the life-time of the future, however you are still calling setError twice on it, which should be undefined behavior - or, following what std::future does, would, well, not throw (because Qt), but might as well assert.

Dec 17 2019, 2:36 PM · KASync, Kube
dvratil added a comment to T12315: Crash with latest kasync master.

Hmm, I believe the bug might be in the Sink code. Here specifically, it's ResourceControl::flush():

Dec 17 2019, 2:34 PM · KASync, Kube

Dec 15 2019

cmollekopf added a comment to T12315: Crash with latest kasync master.

tests/notificationtest in sink will produce a similar crash.

Dec 15 2019, 4:23 PM · KASync, Kube

Dec 13 2019

cmollekopf added a comment to T12315: Crash with latest kasync master.

I have rebuilt the flatpak completely and can reproduce the crash. Also, I can reproduce the crash outside of the flatpak again, not sure what I did above.

Dec 13 2019, 1:16 PM · KASync, Kube

Dec 9 2019

cmollekopf added a comment to T12315: Crash with latest kasync master.

Ever since I have rebuilt a with -fsanitize=address I can no longer reproduce outside of the flatpak, so there's a chance that the fault is with flatpaks internal build chaching that somehow results in something that crashes (I can't think of a reasonable scenario, but who knows).
I'll try to completely rebuild the flatpak as well and see if this fixes the issue.

Dec 9 2019, 9:27 AM · KASync, Kube

Dec 6 2019

cmollekopf added a comment to T12315: Crash with latest kasync master.

Nothing very obvious from the address sanitizer so far, but I also haven't managed to run kube with it yet (only sinksh).

Dec 6 2019, 8:17 PM · KASync, Kube
cmollekopf added a comment to T12315: Crash with latest kasync master.

I'll try that. Next week is fine, no hurry.

Dec 6 2019, 12:29 PM · KASync, Kube
dvratil added a comment to T12315: Crash with latest kasync master.

Looks like some memory issue...could you try compiling with -fsanitize=address? I won't get to look into it properly before some time next week, sorry.

Dec 6 2019, 10:54 AM · KASync, Kube

Dec 4 2019

cmollekopf added a comment to T12315: Crash with latest kasync master.

FWIW; I have attempted but failed to reproduce this in a kasync testcase. I can reproduce it by starting latest kube with latest sink and latest kasync, and I can reproduce the crash in both flatpak (which I have now reverted to kasync 0.3.0), and a locally built kube.

Dec 4 2019, 9:25 AM · KASync, Kube

Dec 3 2019

cmollekopf created T12315: Crash with latest kasync master.
Dec 3 2019, 2:36 PM · KASync, Kube

May 20 2019

cmollekopf closed T8134: Build failure on windows as Resolved.

I'm building with clang on windows meanwhile, and that works fine.

May 20 2019, 9:38 AM · KASync

Mar 2 2018

cmollekopf added a parent task for T8134: Build failure on windows: T1478: Build on windows..
Mar 2 2018, 2:43 PM · KASync
cmollekopf triaged T8134: Build failure on windows as Normal priority.
Mar 2 2018, 2:38 PM · KASync

Apr 6 2017

cmollekopf triaged T3765: Kill task via future as Normal priority.
Apr 6 2017, 6:14 PM · KASync
cmollekopf added a comment to T3765: Kill task via future.

The guard facility should probably be added on the job level, otherwise subjobs can't use the facility to protect themselves.
Guards could work similarly to the context. Call .guard(QObject*/smart pointer) and be sure that no continuation will be called if the guard is gone.

Apr 6 2017, 6:14 PM · KASync

Mar 31 2017

cmollekopf added a comment to T3765: Kill task via future.

Or just do .exec(guard);
The guard object could be any qobject/smart pointer/...

Mar 31 2017, 11:56 AM · KASync

Mar 8 2017

cmollekopf closed T5511: Get rid of never used conversion function warning as Resolved.

Nice!

Mar 8 2017, 11:09 AM · KASync
dvratil moved T5511: Get rid of never used conversion function warning from Backlog to Done on the KASync board.

Fixed in master (see the commit message for details).

Mar 8 2017, 1:28 AM · KASync
dvratil added a commit to T5511: Get rid of never used conversion function warning: R665:9e6d18822962: Fix 'function converting Job<void> to itself will never be used' warning.
Mar 8 2017, 1:27 AM · KASync

Mar 3 2017

cmollekopf closed T5161: First KAsync release as Resolved.
Mar 3 2017, 12:57 PM · KASync

Mar 2 2017

cmollekopf updated the task description for T5511: Get rid of never used conversion function warning.
Mar 2 2017, 11:18 AM · KASync
cmollekopf created T5511: Get rid of never used conversion function warning.
Mar 2 2017, 11:17 AM · KASync

Mar 1 2017

cmollekopf closed T5160: Take KAsync out of frameworks namespace? as Resolved.
Mar 1 2017, 8:59 PM · KASync
cmollekopf added a parent task for T5160: Take KAsync out of frameworks namespace?: T5507: Release 0.1.
Mar 1 2017, 6:17 PM · KASync
cmollekopf added a parent task for T5161: First KAsync release: T5507: Release 0.1.
Mar 1 2017, 6:17 PM · KASync
cmollekopf added a comment to T5161: First KAsync release.

I'd like to do a first 0.1 release as soon as the frameworks removal is merged.

Mar 1 2017, 1:18 PM · KASync
cmollekopf added a revision to T5160: Take KAsync out of frameworks namespace?: D4859: Took kasync out of kf5 namespace.
Mar 1 2017, 1:17 PM · KASync
cmollekopf claimed T5160: Take KAsync out of frameworks namespace?.
Mar 1 2017, 12:42 PM · KASync

Feb 10 2017

cmollekopf closed T5272: Warning on 'visibility' attribute of "QDebug& operator<<(QDebug &dbg, const KAsync::Error &error)" as Resolved.

Thanks for the patch! (I applied it locally and will push it in a bit).

Feb 10 2017, 10:04 AM · Sink, KASync

Feb 6 2017

marcoscarpetta reopened T5272: Warning on 'visibility' attribute of "QDebug& operator<<(QDebug &dbg, const KAsync::Error &error)" as "Open".
Feb 6 2017, 8:10 AM · Sink, KASync
marcoscarpetta added a comment to T5272: Warning on 'visibility' attribute of "QDebug& operator<<(QDebug &dbg, const KAsync::Error &error)".

Ok, I thought that clang had a different syntax for attributes. I found the same error in Sink, this is a patch for it.

Feb 6 2017, 8:10 AM · Sink, KASync

Feb 5 2017

dvratil added a comment to T5272: Warning on 'visibility' attribute of "QDebug& operator<<(QDebug &dbg, const KAsync::Error &error)".

Your initial patch was correct, the KASYNC_EXPORT macro should be at the beginning of the line, Clang is maybe more forgiving regarding the placement of attributes than GCC.... I fixed it in master.

Feb 5 2017, 9:24 PM · Sink, KASync

Feb 4 2017

marcoscarpetta closed T5272: Warning on 'visibility' attribute of "QDebug& operator<<(QDebug &dbg, const KAsync::Error &error)" as Invalid.
Feb 4 2017, 8:46 AM · Sink, KASync
marcoscarpetta added a comment to T5272: Warning on 'visibility' attribute of "QDebug& operator<<(QDebug &dbg, const KAsync::Error &error)".

Sorry, I found this just now. You are using clang. Using options from that json file it builds fine.

Feb 4 2017, 8:38 AM · Sink, KASync
marcoscarpetta created T5272: Warning on 'visibility' attribute of "QDebug& operator<<(QDebug &dbg, const KAsync::Error &error)".
Feb 4 2017, 8:12 AM · Sink, KASync

Jan 24 2017

cmollekopf created T5161: First KAsync release.
Jan 24 2017, 9:34 AM · KASync
cmollekopf created T5160: Take KAsync out of frameworks namespace?.
Jan 24 2017, 9:31 AM · KASync

Jan 12 2017

cmollekopf closed T2197: .then doesn't do any compiletime type checks as Resolved.

It does now with the new .then implementation (the decltype based one). The above example no longer compiles if you get it wrong.

Jan 12 2017, 1:24 PM · KASync
cmollekopf closed T1153: Better support for subjobs as Resolved.

Finally managed to resolve this issue for good (I hope).

Jan 12 2017, 1:23 PM · KASync

Dec 2 2016

cmollekopf closed T1212: Error handling as Resolved.
Dec 2 2016, 10:21 AM · KASync
cmollekopf closed T1245: Keeping other objects alive for the duration of a job (do we need a context?) as Resolved.

Implemented.

Dec 2 2016, 10:20 AM · KASync
cmollekopf closed T3131: KAsync overhaul as Resolved.

Merged to master.

Dec 2 2016, 10:20 AM · KASync

Dec 1 2016

cmollekopf created T4800: Don't require setResult and setFinished to be always called in tandem..
Dec 1 2016, 7:53 PM · KASync
cmollekopf created T4799: Turn make operator T() public and add a static_assert.
Dec 1 2016, 7:45 PM · KASync

Nov 29 2016

ivan placed T1153: Better support for subjobs up for grabs.

I'm guessing this is no longer active

Nov 29 2016, 7:43 PM · KASync

Sep 16 2016

cmollekopf created T3765: Kill task via future.
Sep 16 2016, 8:36 AM · KASync

Aug 10 2016

cmollekopf assigned T3131: KAsync overhaul to dvratil.

please let me know what you think about the overhaul, and whether you see any problems with the approach. cheers

Aug 10 2016, 11:16 AM · KASync

Jul 28 2016

cmollekopf added a comment to T3131: KAsync overhaul.

I have implemented most of this (though it changed a bit) in the dev/kasync2 branch and already ported Sink to it.

Jul 28 2016, 11:51 AM · KASync

Jul 18 2016

cmollekopf added a comment to T3131: KAsync overhaul.

If the handle would become a smart pointer then we could detect if the implementation looses the handle without calling setFinished or setError, and could thus automatically fail the job. Doesn't guard against all failures (if the smart pointer is captured in a lambda that never get's called), but could help with some.

Jul 18 2016, 9:14 AM · KASync

Jul 4 2016

cmollekopf added a comment to T3131: KAsync overhaul.

What I forgot is the context:
Job should have a context that is either a QSet<QVariant> or a QMap<QByteArray, QVariant> or both. The primary usecase at this point is to set smart pointers as the context and thus make sure that the external object lives for the duration of the job. This of course means that the context must survive further compositions (you should be able to set the context in a function that returns a job and have the guarantee that the context will be available during execution.

Jul 4 2016, 8:10 AM · KASync

Jun 30 2016

cmollekopf added a comment to T3131: KAsync overhaul.

This may be fuzzier than I hoped for, but I hope you can understand the general gist of where I'd like to go with this.

Jun 30 2016, 8:53 PM · KASync
cmollekopf updated the task description for T3131: KAsync overhaul.
Jun 30 2016, 8:43 PM · KASync
cmollekopf created T3131: KAsync overhaul.
Jun 30 2016, 8:42 PM · KASync
cmollekopf abandoned D1656: Aggregate error in each.

pushed

Jun 30 2016, 9:57 AM · KASync
cmollekopf closed D1655: Ensure the return type of the previous job matches the parameter of then.
Jun 30 2016, 9:57 AM · KASync

Jun 29 2016

dvratil accepted D1655: Ensure the return type of the previous job matches the parameter of then.

Looks good, thanks for the patch!

Jun 29 2016, 8:56 PM · KASync
dvratil added a comment to D1656: Aggregate error in each.

Looks good, just make small improvement in the test please.

Jun 29 2016, 8:53 PM · KASync
cmollekopf updated the diff for D1656: Aggregate error in each.

Implemented proper error aggregation.

Jun 29 2016, 3:17 PM · KASync
cmollekopf updated the diff for D1655: Ensure the return type of the previous job matches the parameter of then.

Added the proposed changes

Jun 29 2016, 2:39 PM · KASync

Jun 4 2016

dvratil added inline comments to D1656: Aggregate error in each.
Jun 4 2016, 10:19 AM · KASync

Jun 2 2016

cmollekopf added inline comments to D1656: Aggregate error in each.
Jun 2 2016, 8:44 PM · KASync
dvratil added inline comments to D1656: Aggregate error in each.
Jun 2 2016, 8:10 PM · KASync
cmollekopf added inline comments to D1655: Ensure the return type of the previous job matches the parameter of then.
Jun 2 2016, 3:10 PM · KASync
cmollekopf added inline comments to D1656: Aggregate error in each.
Jun 2 2016, 3:10 PM · KASync

May 29 2016

dvratil added inline comments to D1655: Ensure the return type of the previous job matches the parameter of then.
May 29 2016, 10:41 AM · KASync
dvratil added a comment to D1656: Aggregate error in each.

Generally looks good, could you please add a testcase for this?

May 29 2016, 10:26 AM · KASync

May 23 2016

cmollekopf added a project to D1655: Ensure the return type of the previous job matches the parameter of then: KASync.
May 23 2016, 7:40 AM · KASync
cmollekopf added a project to D1656: Aggregate error in each: KASync.
May 23 2016, 7:39 AM · KASync

Apr 9 2016

cmollekopf assigned T1153: Better support for subjobs to ivan.

Let's see if Ivan has any idea how to solve this.

Apr 9 2016, 9:45 PM · KASync
cmollekopf created T2197: .then doesn't do any compiletime type checks.
Apr 9 2016, 9:43 PM · KASync

Feb 10 2016

cmollekopf closed T1159: Fix type of assembled jobs as Resolved.

Huzza! =)

Feb 10 2016, 2:41 PM · KASync

Feb 9 2016

dvratil added a comment to T1159: Fix type of assembled jobs.

Nice! That is a very clever solution! If there are no side effects, feel free to commit it.

Feb 9 2016, 9:29 PM · KASync
cmollekopf added a comment to T1159: Fix type of assembled jobs.

A solution that works is:

Feb 9 2016, 4:27 PM · KASync

Jan 31 2016

cmollekopf added a comment to T1153: Better support for subjobs.

Merged. Should we perhaps keep this ticket open until we figure out the cast problem?

Jan 31 2016, 2:00 PM · KASync

Jan 28 2016

bcooksley updated the image for KASync from Unknown Object (File) to F46817: profile.
Jan 28 2016, 3:28 AM
bcooksley set the image for KASync to Unknown Object (File).
Jan 28 2016, 2:55 AM
bcooksley changed the visibility for KASync.
Jan 28 2016, 2:55 AM

Jan 27 2016

dvratil added a comment to T1153: Better support for subjobs.

Sorry I did not back earlier. The code looks ok, so please merge it as it is, and hopefully we get to solve the cast problem at some point.

Jan 27 2016, 5:29 PM · KASync

Jan 21 2016

cmollekopf added a comment to T1153: Better support for subjobs.

I feel you, I wasted a bunch of time as well already ;-)
Well, at least we learned something. I'll probably give it another try over time, but for the time being I can also live with the extra template argument.
So from my side we can also merge it like this, and try in parallel to improve the solution over time.

Jan 21 2016, 8:17 AM · KASync

Jan 20 2016

dvratil added a comment to T1153: Better support for subjobs.

Yes, the implicit cast to void :) That's where I got stuck too. Basically C++ allows that any function pointer R(*)(T ...) can be cast to void(*)(T ...), which leads to compiler picking either different overload, or throwing ambiguous overload error.

Jan 20 2016, 11:25 PM · KASync
cmollekopf added a comment to T1153: Better support for subjobs.

I also tried a tag dispatch like so

Jan 20 2016, 5:24 PM · KASync