[all-commits] [llvm/llvm-project] daf3cb: [clangd][index-sever] Limit results in repsonse

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Mon May 10 23:28:01 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: daf3cb3b8a5868d9089a69025c556b564615b844
      https://github.com/llvm/llvm-project/commit/daf3cb3b8a5868d9089a69025c556b564615b844
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2021-05-11 (Tue, 11 May 2021)

  Changed paths:
    M clang-tools-extra/clangd/index/remote/server/Server.cpp
    A clang-tools-extra/clangd/test/remote-index/result-limiting.test

  Log Message:
  -----------
  [clangd][index-sever] Limit results in repsonse

This is to prevent server from being DOS'd by possible malicious
parties issuing requests that can yield huge responses.

One possible drawback is on rename workflow. As it really requests all
occurences, but it has an internal limit on 50 files currently.
We are putting the limit on 10000 elements per response So for rename to regress
one should have 10k refs to a symbol in less than 50 files. This seems unlikely
and we fix it if there are complaints by giving up on the response based on the
number of files covered instead.

Differential Revision: https://reviews.llvm.org/D101914


  Commit: 888307ee625b50b060317e2100fb16e0be2626b7
      https://github.com/llvm/llvm-project/commit/888307ee625b50b060317e2100fb16e0be2626b7
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2021-05-11 (Tue, 11 May 2021)

  Changed paths:
    M clang-tools-extra/clangd/index/remote/Client.cpp

  Log Message:
  -----------
  [clangd][remote-client] Set HasMore to true for failure

Currently client was setting the HasMore to true iff stream said so.
Hence if we had a broken stream for whatever reason (e.g. hitting deadline for a
huge response), HasMore would be false, which is semantically incorrect (e.g.
will throw rename off).

Differential Revision: https://reviews.llvm.org/D101915


Compare: https://github.com/llvm/llvm-project/compare/d69bccf1ed30...888307ee625b


More information about the All-commits mailing list