weaver icon indicating copy to clipboard operation
weaver copied to clipboard

The parent context is not propagated to the component when deploying in "single process" mode

Open zailic opened this issue 1 year ago • 3 comments

There could be situations where the component would need the parent context when is initializing. Apparently this is not possible when the application is running in the single process mode because a new context instance is provided when Init method of component is called: Screenshot 2023-12-21 163701 https://github.com/ServiceWeaver/weaver/blob/main/internal/weaver/singleweavelet.go#L285-L290 Is there any reason why there is not used the parent context?

zailic avatar Dec 21 '23 14:12 zailic

I agree we should use a better context! Feel free to open a PR fixing that if you're keen, but otherwise we'll get around to fixing it :)

mwhittaker avatar Jan 02 '24 17:01 mwhittaker

Oh, you already opened a PR! Awesome :)

mwhittaker avatar Jan 02 '24 17:01 mwhittaker

Oh, you already opened a PR! Awesome :)

yes :), thanks for the review!

zailic avatar Jan 02 '24 19:01 zailic