Skip to content

Commit 05190d5

Browse files
committed
chore: remove leftover in progress comment
1 parent 1e5fa6d commit 05190d5

File tree

2 files changed

+43
-34
lines changed

2 files changed

+43
-34
lines changed

agent/fw_laravel_queue.c

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,19 @@ static char* nr_laravel_queue_job_txn_name(zval* job TSRMLS_DC) {
233233
}
234234

235235
/*
236-
* Handle:
237-
* Illuminate\\Queue\\SyncQueue::raiseBeforeJobEvent(Job $job):void
236+
* Handle: Illuminate\Queue\SyncQueue::executeJob
237+
* /**
238+
* Execute a given job synchronously.
239+
*
240+
* @param string $job
241+
* @param mixed $data
242+
* @param string|null $queue
243+
* @return int
244+
*
245+
* @throws \Throwable
246+
protected function executeJob($job, $data = '', $queue = null)
238247
*/
239-
NR_PHP_WRAPPER(nr_laravel_queue_syncqueue_raiseBeforeJobEvent_before) {
248+
NR_PHP_WRAPPER(nr_laravel_queue_syncqueue_executeJob_before) {
240249
zval* job = NULL;
241250

242251
NR_UNUSED_SPECIALFN;
@@ -283,10 +292,15 @@ NR_PHP_WRAPPER_END
283292

284293
/*
285294
* Handle:
286-
* Illuminate\\Queue\\Worker::raiseBeforeJobEvent(string $connectionName, Job
287-
* $job):void
295+
* Illuminate\\Queue\\Worker::process
296+
* @param string $connectionName
297+
* @param \Illuminate\Contracts\Queue\Job $job
298+
* @param \Illuminate\Queue\WorkerOptions $options
299+
* @return void
300+
*
301+
* @throws \Throwable
288302
*/
289-
NR_PHP_WRAPPER(nr_laravel_queue_worker_raiseBeforeJobEvent_after) {
303+
NR_PHP_WRAPPER(nr_laravel_queue_worker_process_before) {
290304
zval* job = NULL;
291305

292306
NR_UNUSED_SPECIALFN;
@@ -300,7 +314,7 @@ NR_PHP_WRAPPER(nr_laravel_queue_worker_raiseBeforeJobEvent_after) {
300314
nr_php_txn_end(1, 0 TSRMLS_CC);
301315

302316
/*
303-
* Laravel 7 and later passes Job as the second parameter.
317+
* Job is the second parameter.
304318
*/
305319
char* txn_name = NULL;
306320

@@ -330,27 +344,22 @@ NR_PHP_WRAPPER(nr_laravel_queue_worker_raiseBeforeJobEvent_after) {
330344
NR_PHP_WRAPPER_END
331345

332346
/*
333-
* Handle:
334-
* Illuminate\\Queue\\Worker::raiseAfterJobEvent(string $connectionName, Job
335-
* $job):void Illuminate\\Queue\\SyncQueue::raiseAfterJobEvent(Job $job):void
347+
* Handles:
348+
* Illuminate\\Queue\\Worker::process
349+
* Illuminate\\Queue\\SyncQueue::executeJob
336350
*/
337-
NR_PHP_WRAPPER(nr_laravel_queue_worker_raiseAfterJobEvent_before) {
351+
352+
NR_PHP_WRAPPER(nr_laravel_queue_worker_after) {
338353
NR_UNUSED_SPECIALFN;
339354
(void)wraprec;
340355

341356
NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_LARAVEL);
342357

343-
/*
344-
* If we made it here, we are assured there are no uncaught exceptions (as it
345-
* would be noticed with the oapi exception handling before calling this
346-
* callback so no need to check before ending the txn.
347-
*/
348-
349358
/*
350359
* End the real transaction and then start a new transaction so our
351360
* instrumentation continues to fire, knowing that we'll ignore that
352-
* transaction either when Worker::process() is called again or when
353-
* WorkCommand::handle() exits.
361+
* transaction either when Illuminate\\Queue\\Worker::process or
362+
* Illuminate\\Queue\\SyncQueue::executeJob is called again
354363
*/
355364
nr_php_txn_end(0, 0 TSRMLS_CC);
356365
nr_php_txn_begin(NULL, NULL TSRMLS_CC);
@@ -854,23 +863,24 @@ void nr_laravel_queue_enable(TSRMLS_D) {
854863
* that is executed, but don't want to record a transaction for the actual
855864
* queue:work command, since it spends most of its time sleeping.
856865
*
857-
* We use the raiseBeforeJobEvent and raiseAfterJobEvent listeners which we
866+
* We use the process and executeJob functions which we
858867
* can use to name the Laravel Job and capture the true time that the job
859868
* took.
860869
*/
861870

871+
/*
872+
* Wrap:
873+
* Illuminate\\Queue\\Worker::process
874+
* Illuminate\\Queue\\SyncQueue::executeJob
875+
*/
862876
nr_php_wrap_user_function_before_after_clean(
863-
NR_PSTR("Illuminate\\Queue\\Worker::raiseBeforeJobEvent"), NULL,
864-
nr_laravel_queue_worker_raiseBeforeJobEvent_after, NULL);
865-
nr_php_wrap_user_function_before_after_clean(
866-
NR_PSTR("Illuminate\\Queue\\Worker::raiseAfterJobEvent"),
867-
nr_laravel_queue_worker_raiseAfterJobEvent_before, NULL, NULL);
868-
nr_php_wrap_user_function_before_after_clean(
869-
NR_PSTR("Illuminate\\Queue\\SyncQueue::raiseBeforeJobEvent"),
870-
nr_laravel_queue_syncqueue_raiseBeforeJobEvent_before, NULL, NULL);
877+
NR_PSTR("Illuminate\\Queue\\SyncQueue::executeJob"),
878+
nr_laravel_queue_syncqueue_executeJob_before,
879+
nr_laravel_queue_worker_after, nr_laravel_queue_worker_after);
871880
nr_php_wrap_user_function_before_after_clean(
872-
NR_PSTR("Illuminate\\Queue\\SyncQueue::raiseAfterJobEvent"),
873-
nr_laravel_queue_worker_raiseAfterJobEvent_before, NULL, NULL);
881+
NR_PSTR("Illuminate\\Queue\\Worker::process"),
882+
nr_laravel_queue_worker_process_before, nr_laravel_queue_worker_after,
883+
nr_laravel_queue_worker_after);
874884

875885
#else
876886

@@ -883,8 +893,9 @@ void nr_laravel_queue_enable(TSRMLS_D) {
883893
* aren't executed if we're not actually in a transaction.
884894
*
885895
* So instead, what we'll do is to keep recording, but ensure that we ignore
886-
* the transaction after WorkCommand::handle() has finished executing, at
887-
* which point no more jobs can be run.
896+
* the transaction before and after
897+
* Illuminate\\Queue\\Worker::process
898+
* Illuminate\\Queue\\SyncQueue::executeJob
888899
*/
889900

890901
nr_php_wrap_user_function(

agent/lib_php_amqplib.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,6 @@ NR_PHP_WRAPPER(nr_rabbitmq_basic_get) {
768768
* want to strdup everything if we don't have to. RabbitMQ basic_get PHP 7.x
769769
* will only strdup server_address and destination_name.
770770
*/
771-
// amber make these peristent for all since retval of null clears the values
772-
// from the cxn
773771
UNDO_PERSISTENCE(message_params.server_address);
774772
UNDO_PERSISTENCE(message_params.destination_name);
775773
}

0 commit comments

Comments
 (0)