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

Updates to internal emitter #659

Merged
merged 5 commits into from Jan 25, 2024
Merged

Conversation

matus-tomlein
Copy link
Contributor

Change default emit timeout from 5 seconds to 30 seconds (#658)
The default timeout for the whole request duration in emitter was set to 5 seconds. This is far from being sufficient on mobile and is a likely cause of the large number of duplicate event reports that we have seen. On slow connections, the request may easily take more than 5 seconds, especially if the phone is switching between cellular and wifi connections.

I have changed it to 30s as we already have a 15s timeout for connection and 15s timeout for read response in the okhttp client config. On iOS, we don't change the default request timeouts which are set to 60 seconds.

Update Emitter constructor to accept namespace and event store and make them immutable
Similar to the change on iOS, this moves the namespace and event store to the constructor of the Emitter. This enables removing some optional and makes the properties immutable and safer.

Fix returning error from network connection requests
This is a fix for a bug that prevented us returning an error value to the emitter when executing a request.

Remove unused threadCount property from Tracker
Minor update that just removes an unused property in the tracker which confused me (there is a similar one in the emitter config).

Set default thread count in Executor to match the default thread pool size in the Emitter
Updates the default thread count in Executor to match the default thread pool size in emitter config. The thread count in Executor is controlled by the thread pool size in the emitter.

Copy link
Contributor

@mscwilson mscwilson left a comment

Choose a reason for hiding this comment

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

LGTM! Some very nice changes

@@ -27,7 +27,7 @@ import java.util.concurrent.Future
object Executor {
private var executor: ExecutorService? = null

var threadCount = 2 // Minimum amount of threads.
var threadCount = EmitterDefaults.threadPoolSize
Copy link
Contributor

Choose a reason for hiding this comment

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

much better!

@matus-tomlein matus-tomlein merged commit 1789fe5 into release/6.0.0 Jan 25, 2024
3 checks passed
@matus-tomlein matus-tomlein deleted the issue/emitter_updates branch January 25, 2024 14:23
@mscwilson mscwilson mentioned this pull request Feb 1, 2024
@matus-tomlein matus-tomlein modified the milestone: 6.0.0 Feb 1, 2024
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.

None yet

2 participants