Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix global threads count var update#923

Merged
alonre24 merged 3 commits into
masterfrom
Fix_global_threads_count_var_update
Jun 2, 2022
Merged

Fix global threads count var update#923
alonre24 merged 3 commits into
masterfrom
Fix_global_threads_count_var_update

Conversation

@alonre24

@alonre24 alonre24 commented Jun 1, 2022

Copy link
Copy Markdown
Collaborator

Update the global variable that indicates the number of RedisAI background threads from the main thread to ensure synchronization upon creating the global ONNX structure. When ONNX model is loaded via AI.MODELSTORE command for the first time, it triggers loading of ONNX backend and allocation of the global array, whose size equals to the number of background threads. Previously, the BG threads themselves where in charge of updating this counter, and there was a race condition that may lead to server crash - https://redislabs.atlassian.net/browse/MOD-3262. This PR is the fix for that issue.

@alonre24 alonre24 requested a review from DvirDukhan June 1, 2022 13:07
@codecov

codecov Bot commented Jun 1, 2022

Copy link
Copy Markdown

Codecov Report

Merging #923 (12a9ccc) into master (2dd4ef1) will increase coverage by 0.44%.
The diff coverage is 96.20%.

@@            Coverage Diff             @@
##           master     #923      +/-   ##
==========================================
+ Coverage   81.30%   81.75%   +0.44%     
==========================================
  Files          54       54              
  Lines        8201     8220      +19     
==========================================
+ Hits         6668     6720      +52     
+ Misses       1533     1500      -33     
Impacted Files Coverage Δ
src/execution/DAG/dag_builder.c 100.00% <ø> (ø)
src/execution/DAG/dag_op.c 100.00% <ø> (ø)
src/execution/parsing/script_commands_parser.c 78.57% <ø> (-0.12%) ⬇️
.../serialization/RDB/decoder/previous/v2/decode_v2.c 46.37% <50.00%> (+0.45%) ⬆️
tests/module/LLAPI.c 75.89% <80.00%> (-0.02%) ⬇️
src/execution/background_workers.c 94.63% <95.23%> (+0.01%) ⬆️
src/redisai.c 89.08% <96.77%> (+1.29%) ⬆️
...backends/libtorch_c/torch_extensions/torch_redis.h 90.90% <100.00%> (ø)
src/backends/tensorflow.c 72.43% <100.00%> (+0.06%) ⬆️
src/execution/DAG/dag.c 91.50% <100.00%> (-0.28%) ⬇️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ae0bdf...12a9ccc. Read the comment docs.

@alonre24 alonre24 merged commit d16b14c into master Jun 2, 2022
@alonre24 alonre24 deleted the Fix_global_threads_count_var_update branch June 2, 2022 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants