07.05.2024 18:20, 'Dimitry Sibiryakov' via firebird-devel:
> Vlad Khorsun wrote 07.05.2024 16:56:
>> You may expect anything you like but first you must understand architecture and how parts
>> communicate with each other. I can explain it again but I'm not sure you want to hear anything
>> you not like. For the start - when trace session is created there is no TraceManager instance
>> that works with this new session. It will be created in another traced connection when some event
>> to trace happens.
>
> It is obvious but this instance of TraceManager has at hand TraceInitInfoImpl which includes ITraceLogWriter exactly to
> communicate with the instance that does work with user session, right?
No. Instances of TraceManager doesn't communicate with each other. Its purpose is to
maintain private list of sessions to trace in parent connection with a corresponding list
of trace plugin's and to call methods of trace plugin's when traced event happens.
> It can use this writer to send "something" to the trace
> session. Currently (by unfortunate design) this "something" is limited to text but still it is better than nothing.
You still far from understanding of design, despite of its "[un]fortunality"
>> Such status will be received far not by the user who starts trace session.
>> And no - manager doesn't send anything into trace log. I already wrote about it.
>
> You wrote this about PluginManager which is a different beast, no?
No. It all was about TraceManager.
>> Seems you not understand who is caller, who is callee and how they are interacts.
>
> May be. English is not my strong side. I call TraceManager::update_session "caller" and ITraceFactory::trace_create "callee"
> because former calls latter.
> For interaction I guess it includes pushing of arguments into a stack and transfer control flow.
It is too hard to understand that
- Service that ask engine to create trace session and then reads the trace log and send its content to
the fbtracemgr application to show it on user console
is not directly related with
- any of other database (and service) connections that each contains own instance of TraceManager that call
trace plugin's that write something into trace log ?
When you run SELECT - do you want to get error happens in BEFORE INSERT trigger of another connection ?
>> When trace factory set error in status, the engine have two possibilities:
>> - raise error in the context of traced connection, or
>> - log error and don't bother user with trace plugin problems.
>
> Did you forgot third possibility "inform about the error trace session which interact to user application"?
No, I didn't forgot not-existing "possibility".
>> Such exception can't be delivered to the trace session as native error. There is
>> no way to pass exception from one connection to another one. And, yes, both connections
>> could be handled by different processes.
>
> Cannot status be serialized to some data buffer and sent to other connection the same way as a text is?
For what ? We can also flight to the Moon, but for what ?
Finally, what do you want ?
You need a way to show plugin init error to the user that started trace ?
It was already shown how to do it.
You want to break all and every user connection when you started trace session with wrong configuration ?
No, it is not allowed - by unfortunate designer.
Vlad