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

Remove returning error message when observer-context is null #86

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

NipunaMadhushan
Copy link
Contributor

@NipunaMadhushan NipunaMadhushan commented Jan 16, 2024

Purpose

When observability enabled and the project contains global variables declared (or init() functions) with client invokes, the following error occurs in the ballerina runtime.

ballerina: started publishing traces to Jaeger on localhost:55680
ballerina: started Prometheus HTTP listener 0.0.0.0:9797
https://api.asgardeo.io/t/bifrost/oauth2/token/.well-known/openid-configurationerror: client method invocation failed: Span already finished. Can not add tag {http.url:/}

The reason for error is that the spans are created only after declaring variables. Spans won't be created for init() functions as well. Therefore we have to skip returning errors for this scenario.

Also observer context is null only at initializing variables.

Fixes ballerina-platform/ballerina-lang#41966, https://github.com/wso2-enterprise/internal-support-ballerina/issues/556

@NipunaMadhushan NipunaMadhushan changed the title Remove returning err msg when observer-context is null Remove returning error msg when observer-context is null Jan 16, 2024
@NipunaMadhushan NipunaMadhushan changed the title Remove returning error msg when observer-context is null Remove returning error messsage when observer-context is null Jan 18, 2024
@NipunaMadhushan NipunaMadhushan changed the title Remove returning error messsage when observer-context is null Remove returning error message when observer-context is null Jan 18, 2024
Copy link
Contributor

@warunalakshitha warunalakshitha left a comment

Choose a reason for hiding this comment

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

LGTM

@NipunaMadhushan NipunaMadhushan merged commit 8a83060 into ballerina-platform:main Jan 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Project fails when there are global variables declared with client invokes
3 participants