{"action":"created","issue":{"url":"https://api.github.com/repos/dmwm/WMCore/issues/6241","labels_url":"https://api.github.com/repos/dmwm/WMCore/issues/6241/labels{/name}","comments_url":"https://api.github.com/repos/dmwm/WMCore/issues/6241/comments","events_url":"https://api.github.com/repos/dmwm/WMCore/issues/6241/events","html_url":"https://github.com/dmwm/WMCore/issues/6241","id":106553781,"number":6241,"title":"Inconsistent usage of max_list_len","user":{"login":"amaltaro","id":1798520,"avatar_url":"https://avatars.githubusercontent.com/u/1798520?v=3","gravatar_id":"","url":"https://api.github.com/users/amaltaro","html_url":"https://github.com/amaltaro","followers_url":"https://api.github.com/users/amaltaro/followers","following_url":"https://api.github.com/users/amaltaro/following{/other_user}","gists_url":"https://api.github.com/users/amaltaro/gists{/gist_id}","starred_url":"https://api.github.com/users/amaltaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaltaro/subscriptions","organizations_url":"https://api.github.com/users/amaltaro/orgs","repos_url":"https://api.github.com/users/amaltaro/repos","events_url":"https://api.github.com/users/amaltaro/events{/privacy}","received_events_url":"https://api.github.com/users/amaltaro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-15T13:18:10Z","updated_at":"2015-09-15T17:38:31Z","closed_at":null,"body":"@yuyiguo @ticoann this is the issue I mentioned yesterday, which is hitting us in production right now.\r\n\r\nIt seems we have an inconsistent usage of this max_list_len (for lumi_list for instance) between dbs client and server.\r\n\r\nIn the dbsClient code, we check the length of the list regardless whether it's a plain or a nested list (cannot be bigger than 1000, otherwise we slice it):\r\nhttps://github.com/dmwm/DBS/blob/d58e4fe7be87a6f84da4f246523641c9988ba1ef/Client/src/python/dbs/apis/dbsClient.py#L1009\r\n\r\non the server side, we first expand this lumi_list in a plain list and then AND only then we check it against\r\nthe max length\r\nhttps://github.com/dmwm/DBS/blob/00f44b9b32cefd79888eb1ded0ab8e359ab47965/Server/Python/src/dbs/web/DBSReaderModel.py#L910\r\n\r\nwhere the following nested list\r\n[[248, 494], [534, 546], [638, 650], [794, 1313], [1327, 1339], [1353, 1482], [1496, 1573], [1652, 1664], [1743, 1755], [1860, 1872]]\r\n\r\nhas 1053 elements, thus DBSServer returns a Bad Request.\r\n\r\nBefore putting more effort on it, I'd like to know whether we should fix it on the DBS side\r\n a. checking their length before any expansion\r\n b. if passes previous test but it's bigger, either go ahead or slice on the client side\r\nor fix it in WMCore\r\n a. always expand from range of lumis to a plain lumi list and make POST calls with this plain list."},"comment":{"url":"https://api.github.com/repos/dmwm/WMCore/issues/comments/140476928","html_url":"https://github.com/dmwm/WMCore/issues/6241#issuecomment-140476928","issue_url":"https://api.github.com/repos/dmwm/WMCore/issues/6241","id":140476928,"user":{"login":"amaltaro","id":1798520,"avatar_url":"https://avatars.githubusercontent.com/u/1798520?v=3","gravatar_id":"","url":"https://api.github.com/users/amaltaro","html_url":"https://github.com/amaltaro","followers_url":"https://api.github.com/users/amaltaro/followers","following_url":"https://api.github.com/users/amaltaro/following{/other_user}","gists_url":"https://api.github.com/users/amaltaro/gists{/gist_id}","starred_url":"https://api.github.com/users/amaltaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaltaro/subscriptions","organizations_url":"https://api.github.com/users/amaltaro/orgs","repos_url":"https://api.github.com/users/amaltaro/repos","events_url":"https://api.github.com/users/amaltaro/events{/privacy}","received_events_url":"https://api.github.com/users/amaltaro/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T17:38:31Z","updated_at":"2015-09-15T17:38:31Z","body":"Almost :) It does not really reach oracle. In the client side we have a list of lists where its length is smaller than 1000, so no slicing is needed here. However, the first thing done on the server side is expanding this list of lists in a plain list, which goes beyond the 1000 limit. Since the server does not apply any slices, it simply raises an exception in this case:\r\nhttps://github.com/dmwm/DBS/blob/00f44b9b32cefd79888eb1ded0ab8e359ab47965/Server/Python/src/dbs/web/DBSReaderModel.py#L929\r\n\r\nI agree with you, it would be better to fix it in the DBS side. I'll create a temporary agent patch tomorrow."}}