Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use plugin-dispatcher all the way for internal eventsByPersistenceId, #886 #888

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

patriknw
Copy link
Member

@patriknw patriknw commented Apr 21, 2021

References #886

}
.withAttributes(ActorAttributes.dispatcher(sessionSettings.pluginDispatcher))
.runWith(Sink.ignore)
.map(_ => ())(akka.dispatch.ExecutionContexts.sameThreadExecutionContext)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only looked at the recovery usage of eventsByPersistenceId so far. With these changes it's all on the plugin dispatcher, which it wasn't before.

Wonder if the inner ActorAttributes.dispatcher in CassandraReadJournal will still create an unwanted async boundary, even though same dispatcher? I'll check.

I have to verify with Akka 2.6 also.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if the inner ActorAttributes.dispatcher in CassandraReadJournal will still create an unwanted async boundary, even though same dispatcher?

That's how it's documented anyway, so we would have to get rid of that if we are looking for optimal (and then maybe the attribute bugs will make that impossible).

I think I'll leave that part of the investigation to the 1.0 (master) version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concern with the read side was if the user runs their side on a different dispatcher and get two async boundaries, but I think I was wrong about that, since the operators with unspecified dispatcher would "inherit" the one the user selected, so it would only be the one between the plugin dispatcher and "the rest of the stream".

println(s"# asyncReplayMessages replayCallback ${Thread.currentThread().getName}") // FIXME
replayCallback(p)
}
.withAttributes(ActorAttributes.dispatcher(sessionSettings.pluginDispatcher))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want the Sink.ignore on the same dispatcher as well, so .to(Sink.ignore) and then the dispatcher attribute for the whole graph

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, thanks

}
.withAttributes(ActorAttributes.dispatcher(sessionSettings.pluginDispatcher))
.runWith(Sink.ignore)
.map(_ => ())(akka.dispatch.ExecutionContexts.sameThreadExecutionContext)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concern with the read side was if the user runs their side on a different dispatcher and get two async boundaries, but I think I was wrong about that, since the operators with unspecified dispatcher would "inherit" the one the user selected, so it would only be the one between the plugin dispatcher and "the rest of the stream".

@patriknw patriknw marked this pull request as ready for review April 21, 2021 12:57
@patriknw
Copy link
Member Author

@johanandren I changed a few more. Could you take another look? (modulo the println that I'll remove)

Copy link
Member

@johanandren johanandren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@patriknw patriknw changed the title Use plugin-dispatcher all the way, #866 Use plugin-dispatcher all the way, #886 Apr 21, 2021
@ignasi35
Copy link
Contributor

Travis complains: toomanyrequests: You have reached your pull rate limit (ref akka/akka-meta#150)

@patriknw
Copy link
Member Author

I have also verified this with an old sample with Akka 2.6.x.

I think this is enough, at least for releasing 0.107.

I'll remove the println now.

@patriknw patriknw changed the title Use plugin-dispatcher all the way, #886 Use plugin-dispatcher all the way for internal eventsByPersistenceId, #886 Apr 21, 2021
@patriknw patriknw force-pushed the wip-886-more-disp-attr-patriknw branch from ad3ce37 to e0d1676 Compare April 21, 2021 13:51
@patriknw
Copy link
Member Author

toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
396The command "export JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64

merging anyway because it was only on of the jobs that failed and others were successful

@patriknw patriknw merged commit 4ce9ae1 into release-0.x Apr 22, 2021
@patriknw patriknw deleted the wip-886-more-disp-attr-patriknw branch April 22, 2021 07:10
@patriknw patriknw added this to the 0.107 milestone Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants