x-lambda
x-lambda
hi,我看到代码里有提到`alt stack`,不是很了解,可以帮忙科普一下吗?
``` newCtx := metadata.NewIncomingContext(ctx, md) out, err := s.server.(BlogServiceHTTPServer).GetArticles(newCtx, &in) ``` 大佬还是这个ctx转换问题,这里使用metadata转换有啥特殊的原因吗? 我如果直接使用 ``` newCtx := ctx.Request.Context() ``` 后续的操作,`db.Exec()/http.Do()/redis.Do()`都会检查`ctx.Done()`来判断是否超时,这样我的超时就可以控制在更细的粒度。 能否解答一下这2种,哪种更好一点呢?
## Description 在给`gin`服务添加超时控制的时候,由于一个接口需要返回重定向,然后导致了进程`panic`,怀疑是 ```golang // Redirect returns an HTTP redirect to the specific location. func (c *Context) Redirect(code int, location string) { c.Render(-1, render.Redirect{ Code: code, Location: location, Request: c.Request,...
Hello , I followed your writing method and encountered the following problem, Can you help locate the reason? ``` fatal error: concurrent map writes goroutine 911183 [running]: runtime.throw({0x17ce3c9?, 0x20307a?}) /root/sdk/go1.18.9/src/runtime/panic.go:992...
I test gin-timeout, and it's ok https://github.com/vearne/gin-timeout/blob/master/timeout.go#L33 ``` cp := *c //nolint: govet c.Abort() // sync.Pool buffer := buffpool.GetBuff() tw := &TimeoutWriter{body: buffer, ResponseWriter: cp.Writer, h: make(http.Header)} tw.TimeoutOptions = defaultOptions...
## Feature Request ### Describe your feature request related problem ### Describe the feature you'd like I clone and change pd source code, and `make build` successed. but it can't...