question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.7.3] setFlushThresholds(0, 0) make sending notification delayed

See original GitHub issue

Test code:

public class PushyTest {
    public static void main(String[] args) throws Exception {
        ApnsClient<SimpleApnsPushNotification> apnsClient;
        apnsClient = new ApnsClient<>(...);
        apnsClient.setFlushThresholds(0, 0);

        apnsClient.connect(ApnsClient.DEVELOPMENT_APNS_HOST).await();
        System.out.println("connected");

        // Wait event loop to start polling
        Thread.sleep(1000);

        SimpleApnsPushNotification notification = new SimpleApnsPushNotification(...);
        System.out.println("send begin");
        apnsClient.sendNotification(notification).await();
        System.out.println("send complete");
        apnsClient.disconnect().await();
    }
}

It takes very long time between send begin and send complete. If changed to setFlushThresholds(1, 1), it is sent immediately.

Stack dump right after send begin shows NioEventLoop blocked at select() call.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jchamberscommented, Jun 28, 2016

Yep—that sounds problematic 😉

I’m curious why you’re having this issue here, but we don’t see the same thing in ApnsClientTest#testSendNotificationWithImmediateFlush(). Will investigate, though as @ewmkkpe points out, the flush thresholds will be going away shortly (see #326).

0reactions
jchamberscommented, Aug 8, 2016

After some thought, I’ve decided to roll back fancy flushing entirely. This should no longer be an issue now that #350 is merged. We’ll look forward to upstream support for this feature in the near future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 10 Ways to Fix Delayed Notifications on Android
Android apps not sending notifications right away? Apply these troubleshooting tips to fix delayed notifications issues on Android.
Read more >
Notifications Delayed - OneSignal Documentation
Possible reasons notifications can be delayed or not shown quickly. Normally push notifications arrive quite quickly. The most common reason for notifications ......
Read more >
Fix- Notification Delay on iPhone! - YouTube
Are you getting delayed notifications from social media apps like ... 0 :00 What this video is about 0 :28 Things to make...
Read more >
Delayed Notifications Issue on iPhone and iPad after iOS 14.4
How to fix notifications delay on all apps on iPhone, Why am I receiving notifications delay after iOS 14, Whatsapp delayed Notifications on ......
Read more >
Delaying an Email Notification from being sent - ServiceNow
Solved: Hello SN Comm, I am looking to see what is the best way to Delay an Email notification that is triggered from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found