1

I currently have a legacy project that handles push notifications , whose subscriber base is in Firebase, for the subscription uses a function in the gcloud platform are the following technologies.

Node: "10" firebase-admin ":" ^ 8.9.2 ", firebase-functions ":" ^ 3.3.0 "

When a notification is created, a .json file is generated that is sent to different vps, same that dispatch the notifications to the subscribers of the base.

However as of the 11th of this month, it started throwing random 502 errors, something that previously did not happen. The function that send the 502 is the next:

return webpush.sendNotification(suscription,data,options)
  .then((r) => {
    console.log('r',r);
  })
  .catch((err) => {

    console.log('err',err);

    if (err.statusCode === 410) {
        log('Rem '+ key);
      return suscribersref.child(key).set(null);
    } 
    else if(err.statusCode === 404 || err.statusCode === 400){
        log('Not a valid endpoint, status code: '+ err.statusCode);
        log('Rem '+ key);
        return suscribersref.child(key).set(null);
    }
    else {
        log('Subscription is no longer valid: ', err);
        log('Rem '+ key);
        return suscribersref.child(key).set(null);
    }
  });

No changes have been made to the implementation. While on the CMS(CMS is in python 3.6) side I get the following error in the logs :

requests.exceptions.ReadTimeout: HTTPSConnectionPool (host = 'pol.firebaseio.com', port = 443): Read timed out. (read timeout = 60)

the line of code that triggers it is the following:

fb              = firebase.FirebaseApplication(settings.FIREBASE_URL, None)
NotifyServers = fb.get('/nserv', None)

how it could increase the response time and what could be causing it? Thanks.

LHernandez
  • 11
  • 1

0 Answers0