Cloud function on GCP no exit log

0 votes

I have a google cloud function triggered by a topic pubsub.

Most of the times, everything works fine like this:

2021-11-06 15:12:38.830 GMT vote_stage oga5hymuzx4p Function execution started
2021-11-06 15:13:45.392 GMT vote_stage oga5hymuzx4p Function execution took 66563 ms, finished with status: 'ok' 

But unfortunately, once in twenty, i can only see this:

2021-11-06 15:08:45.139 GMT vote_stage rvfnd4wo5nwd Function execution started

How is this possible that there is no exit log ?

Below, the code of the function:

def vote_stage(event, context):
    assert context == context
    call_datetime = reusable.time.get_now()
    game_id = event['attributes']['game_id']
    logger.info(f'start, game_id={game_id}')
    game = build_game(game_id)
    resp = ut.exceptions.ExceptionsHandler(game).handle_vote_stage_exceptions()
    if resp:
        logger.info(f'exception, game_id={game_id}')
        return resp
    game.dict['vote_stage_last_trigger'] = reusable.time.get_now()
    ut.firestore.FirestoreEditor(game).set_game(merge=True)

    while True:
        game = build_game(game_id)
        ut.slack.SlackOperator(game).update_vote_stage_lower()
        c1 = len(game.frozen_guessers) == 1
        c2 = game.time_left_to_vote <= 0
        c3 = not game.remaining_potential_voters
        if c1 or c2 or c3:
            game.dict['frozen_voters'] = deepcopy(game.dict['voters'])
            game.dict['vote_stage_over'] = True
            ut.firestore.FirestoreEditor(game).set_game(merge=True)
            game.stage_triggerer.trigger_pre_result_stage()
            logger.info(f'pre_result_stage triggered, game_id={game_id}')
            return make_response('', 200)
        if ut.time.datetime1_minus_datetime2(
                reusable.time.get_now(),
                call_datetime) > game.self_trigger_threshold:
            game.stage_triggerer.trigger_vote_stage()
            logger.info(f'vote_stage self-triggered, game_id={game_id}')
            return make_response('', 200)
        time.sleep(game.refresh_interval)

Here, game.self_trigger_threshold = 60s and game.refresh_interval = 9s. The vote_stage function has a timeout of 540s.

The method game.stage_triggerer.trigger_pre_result_stage() publishes a message to a topic "topic_pre_result_stage" which triggers the "pre_result_stage" cloud function.

The method game.stage_triggerer.trigger_vote_stage() publishes a message to a topic "topic_vote_stage" which triggers the "vote_stage" cloud function.

The only inner log i find is:

2021-11-06 15:08:49.594 GMT vote_stage rvfnd4wo5nwd 2021-11-06 15:08:49,594 - INFO - start, game_id=20211106_150714&T01LTPERV4Z&C02EKL5PQAX&U01LFAZNKPV&2694551026434.1707796879169.ce017050e1e74e97332c2a04d4b19c08
Apr 11 in GCP by Rahul
• 2,540 points
14 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In GCP

0 votes
1 answer

Deciding on a Cloud load balancer in gcp.

Google Cloud Platform Load Balancing enables you ...READ MORE

answered Sep 26, 2019 in GCP by Sirajul
• 59,170 points
354 views
0 votes
1 answer

What are the libraries and tools for cloud storage on GCP?

At the center level, XML API and ...READ MORE

answered Oct 7, 2019 in GCP by Sirajul
• 59,170 points
694 views
+1 vote
1 answer

Error while using a HTTP Cloud function in GCP.

If CORS isn't set up properly, you're ...READ MORE

answered Oct 23, 2019 in GCP by Sirajul
• 59,170 points
498 views
+1 vote
1 answer

Create a Cloud Filestiore instance on GCP.

You could create a cloud filestore instance ...READ MORE

answered Nov 22, 2019 in GCP by Sirajul
• 59,170 points
254 views
+2 votes
1 answer

How to launch one instance on GCP Cloud from command line?

Hi@akhtar, You can compute service in GCP to launch ...READ MORE

answered Aug 24, 2020 in GCP by MD
• 95,340 points
286 views
+2 votes
1 answer

Create a firewall rule on GCP Cloud from command line.

Hi@akhtar, You need to configure GCP Cloud SDK ...READ MORE

answered Aug 24, 2020 in GCP by MD
• 95,340 points
933 views
0 votes
1 answer

Google Cloud VPN - Egress from GCP to on-premise pricing clarification

IPSec traffic are charged as if the ...READ MORE

answered Mar 20 in GCP by Korak
• 4,460 points
26 views
0 votes
1 answer

Which GPU should I use on Google Cloud Platform (GCP)

It all depends on what characteristics you ...READ MORE

answered Mar 20 in GCP by Korak
• 4,460 points
39 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP