fabric8-services / fabric8-wit

wit stands for Work Item Tracker
http://devdoc.almighty.io/
Apache License 2.0
45 stars 86 forks source link

Null response when creating workitems via REST API under load #1209

Open pmacik opened 7 years ago

pmacik commented 7 years ago

Expected behavior

Actual behavior

When the core is under load by the requests to create new workitems via POST /api/space/<space_id>/workitems REST API it fails and returns a null response after a while:

[payload=[null]; headers={}; properties={}]

Steps to reproduce the problem

-

Specifications

aslakknutsen commented 7 years ago

What's the http status code?

pmacik commented 7 years ago

The server returned an unexpected HTTP response code: 401 "Unauthorized". Expected HTTP codes are 201.

pmacik commented 7 years ago

I will soon have the logs from the core so I'll attach it here.

aslakknutsen commented 7 years ago

This is running against sso.prod-preview right?

pmacik commented 7 years ago

I believe so:

time="2017-04-19 10:39:56" level=error msg="Unable to obtain entitlement resource" entitlement_resource=&{[{4e0456c0-9e69-49df-8750-61092028df75 <nil>}]} err="Post https://sso.prod-preview.openshift.io/auth/realms/fabric8-test/authz/entitlement/fabric8-online-platform: EOF" file="/tmp/go/src/github.com/almighty/almighty-core/auth/authz.go" func="github.com/almighty/almighty-core/auth.GetEntitlement" identity_id=ad3d8a9d-3a33-40a6-afd2-1f50514388b8 line=642 pid=1 pkg=auth req_id=FOKAgVgLzl-37858
time="2017-04-19 10:39:56" level=warning msg="no authorization found in the token; this is an access token (not a RPT token)" file="/tmp/go/src/github.com/almighty/almighty-core/space/authz/authz.go" func="github.com/almighty/almighty-core/space/authz.(*KeycloakAuthzService).Authorize" identity_id=ad3d8a9d-3a33-40a6-afd2-1f50514388b8 pkg="space/authz" req_id=FOKAgVgLzl-37858 space-id=4e0456c0-9e69-49df-8750-61092028df75
aslakknutsen commented 7 years ago

@alexeykazakov `^

alexeykazakov commented 7 years ago

@pmacik are you sure you are running https://github.com/almighty/almighty-core/commit/1db36cf786314a7124404564727d2dbb73885af0 ? We do not do any space authorization for POSTs anymore - https://github.com/almighty/almighty-core/pull/1205

pmacik commented 7 years ago

I still encounter the null response in https://github.com/almighty/almighty-core/commit/8e825e2921a9e851b7d1fe95030d6a00f0961dee .

pmacik commented 7 years ago

Today I run the test against clean prod server (both server and db clean and empty) and after ~13k workitems created this happend.

There was no error correlated in the core's log