request.headerMap() not working

104 views
Skip to first unread message

svs...@gmail.com

unread,
Nov 15, 2016, 2:41:59 AM11/15/16
to Baratine
when call die method headerMap() on RequestWeb, I get an UnsupportedOperationException. It seems, that you use a MultiMapImpl, that implements add, but not put. but in headerMap you are using a put instead ob an add in this line:

headerMap.put(this.requestHttp().getHeaderKey(i).toString(), values);

so, am I doing something wrong or is this method simply not working as supposed?

svs...@gmail.com

unread,
Dec 1, 2016, 8:35:06 AM12/1/16
to Baratine, svs...@gmail.com
> when call die method headerMap() on RequestWeb, I get an UnsupportedOperationException. It seems, that you use a MultiMapImpl, that implements add, but not put. but in headerMap you are using a put instead ob an add in this line:
>
> headerMap.put(this.requestHttp().getHeaderKey(i).toString(), values);
>
> so, am I doing something wrong or is this method simply not working as supposed?


after more than 2 weeks after my question with no response... is this project still active or is it already dead?

when I check baratine out of github and build it, there are only 32 tests running. Are these all tests that exists for checking, that baratine is doing what it should do?

With this kind of state it seems problematic to use baratine for a production service...

Alex Rojkov

unread,
Dec 1, 2016, 6:26:49 PM12/1/16
to svs...@gmail.com, Baratine
Hello,

The tests included in Baratine at github are testing JUnit runners for
Baratine. They are not testing Baratine. Complete test suit for
Baratine resides in a private repository.

You can contact the company at baratine аt caucho dоt com for
information on product road map.

Regards,
Alex
> --
> You received this message because you are subscribed to the Google Groups "Baratine" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to baratine-io...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

svs...@gmail.com

unread,
Dec 2, 2016, 1:35:30 AM12/2/16
to Baratine, svs...@gmail.com
do you have tests for RequestBaratineImpl.headerMap()?

it seems unlikely, that such a basic function is not working.

we are evaluating different frameworks for micro services in the moment. but the first try with baratine with a really small example resulted in an error inside baratine. that's not promising.

Alex Rojkov

unread,
Dec 2, 2016, 5:57:32 PM12/2/16
to svs...@gmail.com, Baratine
Hello,

You are correct, this method was not tested. I've reproduced the issue
and submitted a fix. The fix is available via
https://github.com/baratine/baratine and will go into next release.

Thanks for trying Baratine.
Alex

svs...@gmail.com

unread,
Dec 5, 2016, 3:17:09 AM12/5/16
to Baratine, svs...@gmail.com
thanks for fixing this!

but now I get some "Free-Failed: 512" messages from ProtocolHttp.requestFree(RequestHttp1 request).

Is this a problem -- e.g. a potential memory leak?

And is there a reason, why you are outputting this via

System.out.println("Free-Failed: " + _freeRequest.size());

and not using a logger?

regards

> Hello,
>
> You are correct, this method was not tested. I've reproduced the issue
> and submitted a fix. The fix is available via
> https://github.com/baratine/baratine and will go into next release.
>
> Thanks for trying Baratine.
> Alex
>

Alex Rojkov

unread,
Dec 5, 2016, 1:11:48 PM12/5/16
to svs...@gmail.com, Baratine
Hi,

512 is the number of requests that Baratine will keep for re-use. If
Request can't be reused it will be GCed.

We need to change to logging for this, thanks for pointing that out.
This was overlooked for the release unfortunately.

What is your use case? I'd like to reproduce your use case and check
if things are happening the way they should for Request reuse.

Thank you!
Alex

svs...@gmail.com

unread,
Dec 7, 2016, 1:28:06 AM12/7/16
to Baratine, svs...@gmail.com
the use case is:

getting all headers, filtering some out and outputting them as JSON.

but the "Free-Failed" messages I get also when just calling a simple status function:

@Get("/status")
public void status(final RequestWeb request) {
request.ok("ok!");
}

when calling

wrk -t20 -c500 -d30s http://localhost:8080/status

I get:

{ThreadLauncher[ThreadPool[default]]-1@12} WARNING ThreadLauncher: ThreadLauncher[ThreadPool[default]] 256 threads created in 1000ms sleep=1ms
Free-Failed: 493
Free-Failed: 498
Free-Failed: 507
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511
Free-Failed: 512
Free-Failed: 511
Free-Failed: 511
Free-Failed: 511
Free-Failed: 512
Free-Failed: 511
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 510
Free-Failed: 512
Free-Failed: 509
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511
Free-Failed: 509
Free-Failed: 512
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511
Free-Failed: 511
Free-Failed: 511
Free-Failed: 512
Free-Failed: 511
Free-Failed: 512
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511
Free-Failed: 510
Free-Failed: 512
Free-Failed: 512
Free-Failed: 509
Free-Failed: 511
Free-Failed: 511
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 505
Free-Failed: 510
Free-Failed: 510
Free-Failed: 510
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511
Free-Failed: 511
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 510
Free-Failed: 512
Free-Failed: 510
Free-Failed: 511
Free-Failed: 511
Free-Failed: 512
Free-Failed: 511
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 512
Free-Failed: 511

so, is this a problem or just some debug messages, that does not point to a problem?

regards


> Hi,
>
> 512 is the number of requests that Baratine will keep for re-use. If
> Request can't be reused it will be GCed.
>
> We need to change to logging for this, thanks for pointing that out.
> This was overlooked for the release unfortunately.
>
> What is your use case? I'd like to reproduce your use case and check
> if things are happening the way they should for Request reuse.
>
> Thank you!
> Alex
>
>
>

Alex Rojkov

unread,
Dec 7, 2016, 12:00:15 PM12/7/16
to svs...@gmail.com, Baratine
Hi,

The only problem with this is a that we need to rethink the warning
and the size of the free request stack. We might increase it in the
future.

I am pretty sure that the initial thinking behind using System.out.
is making sure we see the message regardless of how the loggers are
configured.

I've changed that now to use Logger.warning(). The size of the stack
remains the same for now.

Thanks,
Alex

benah...@gmail.com

unread,
Jul 19, 2017, 3:52:55 AM7/19/17
to Baratine, svs...@gmail.com
Reply all
Reply to author
Forward
0 new messages