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

[Bug][pulsar-function]Pulsar Function processing time doesn't get properly recorded for asynchronous functions #23787

Conversation

walkinggo
Copy link
Contributor

Main Issue: #23705

Motivation

In the code, the asynchronous function is not handled properly. stats.processTimeEnd() is called immediately when the result is returned, but we should wait for the asynchronous task to complete before processing.

Modifications

Passed stats as a parameter into the function, and called stats.processTimeEnd() after the function call completes. Also, updated the corresponding test cases.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 26, 2024
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

This needs a different approach since there could be multiple messages in flight. The current duration calculation expects one-by-one messages handling.

@walkinggo
Copy link
Contributor Author

This needs a different approach since there could be multiple messages in flight. The current duration calculation expects one-by-one messages handling.

Sorry, I'm not quite sure I understand your point. Are you referring to the potential issue when multiple messages are being processed, where they might share the same stats variable, leading to the modification of the same processTimeStart variable after calling processTimeStart in ComponentStatsManager?

@lhotari
Copy link
Member

lhotari commented Jan 2, 2025

This needs a different approach since there could be multiple messages in flight. The current duration calculation expects one-by-one messages handling.

Sorry, I'm not quite sure I understand your point. Are you referring to the potential issue when multiple messages are being processed, where they might share the same stats variable, leading to the modification of the same processTimeStart variable after calling processTimeStart in ComponentStatsManager?

Yes, that's a problem which needs to be addressed. One possible solution is to keep the starting time state completely outside of the ComponentStatsManager.

@walkinggo
Copy link
Contributor Author

I try to finish it in another pr #23811 becasue i use different branch.i will close this pr,please check it in next pr.

@walkinggo walkinggo closed this Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants