You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
The issue is that we use RequestCtx in NeoFS API calls. Client from neofs-sdk-go creates new context with cancellation, and it triggers RequestCtx.Done(). This method is not thread-safe, because returned channel is set to nil at server shutdown. So data race detector sometimes can be triggered on this.
I don't think this fasthttp behaviour will be changed. But providing separate context to the NeoFS API calls seems like an overhead for me to solve corner-case at the shutdown. So maybe the better option is to drop data race check in integration test once again.
But providing separate context to the NeoFS API calls seems like an overhead for me to solve corner-case at the shutdown
Are we sure that there is only one corner-case?
Concurrent read/write access to the Done() channel of RequestCtx is only possible at shutdown, because done channel variable is not modified in runtime.
It is meaningless to use RequestCtx as a context.Context
for NeoFS operation, because context won't be closed
until application shutdown. Moreover, it also triggers
data race detection, because server's done channel, which
is accessible for reading from RequestCtx, is set to `nil`.
Using application context doesn't change gateway behavior,
but it suppresses data race trigger at shutdown. It also
allows possibility to set configurable timeouts for NeoFS
networking if we will ever need them.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Related to #130 and #131
Sometimes I still get data race errors in integration test. These errors are inconsistent, see https://github.com/nspcc-dev/neofs-http-gw/runs/6061957808 (tests are passed, but data coverage failed due to data race error).
The issue is that we use
RequestCtx
in NeoFS API calls. Client fromneofs-sdk-go
creates new context with cancellation, and it triggersRequestCtx.Done()
. This method is not thread-safe, because returned channel is set tonil
at server shutdown. So data race detector sometimes can be triggered on this.I don't think this
fasthttp
behaviour will be changed. But providing separate context to the NeoFS API calls seems like an overhead for me to solve corner-case at the shutdown. So maybe the better option is to drop data race check in integration test once again.The text was updated successfully, but these errors were encountered: