opened
gregkalapos
username_0
Sending requests in parallel to the agent fails:

``` AssertionError: queried for [('processor.event', 'transaction'), ('service.name', ['dotnetapp'])], expected 1000, got 832```

Logs from the agent: 
[agentlogs_failingconcurrentTest.txt](https://github.com/elastic/apm-agent-dotnet/files/3132407/agentlogs_failingconcurrentTest.txt)
Failing concurrent integration test
issue
created
gregkalapos
username_0
I suspect this is a bug in `PaylodSender`. 

Number of `[Debug] - {Tracer} Starting Transaction` logs: 1000. (also 100 for ending `Ending Transaction`)
Number of `{PayloadSenderV2} Sent items to server` logs: 768. (some of those batches send more than 1 transaction! )

Now, the way this works is that every `Transaction.End` forces the `PayloadSender` to send data (spans are batched until 20 items). 

But I suspect that due to the parallelism some Transactions remain in the queue. I planned to add some timeout and send those... maybe that's the way to go.
comment
created
gregkalapos
username_0
The problem is that we can't queue the Transansactions:

```
public void QueueTransaction(ITransaction transaction)
{
   _eventQueue.Post(transaction)) //<-- this returns false and the `transaction` won't be in the `BatchBlock`, so we don't send it to the server 
   _eventQueue.TriggerBatch();
}
```
comment
created
gregkalapos
username_0
Fixed in https://github.com/elastic/apm-agent-dotnet/pull/219
comment
closed
gregkalapos
username_0
issue