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

[Cloud Run] app.current_request can be rewritten by subsequent requests while function is running #459

Open
brianhlee opened this issue Nov 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@brianhlee
Copy link
Contributor

No description provided.

@anovis anovis added the bug Something isn't working label Nov 15, 2023
@brianhlee
Copy link
Contributor Author

Test I ran looked like

@app.pubsub_subscription(
    os.getenv("PUBSUB_TOPIC"),
    use_subscription=True,
)
def main(event):
    change_event = json.loads(event)
    attributes = app.current_request.json["message"].get("attributes")
    v1 = change_event["value"]
    v2 = attributes["value"]
    if v2 != v1:
        app.log.error(f"{v2}:{v1}")

sent pubsub messages all at once using

for i in range(1000):
    data = json.dumps(
        {
            "value": str(i)
        })
    publish_future = publisher.publish(topic_path, data.encode("utf-8"), value=str(i))

which logged:
ERROR:goblet.app:872:468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants