Skip to content

Conversation

@TreyE
Copy link
Contributor

@TreyE TreyE commented Dec 16, 2025

@TreyE TreyE force-pushed the cu-868gra3td branch 2 times, most recently from d9f8ddb to d3880fc Compare December 17, 2025 21:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds publisher confirms support for RabbitMQ quorum queues, ensuring message delivery reliability through the publisher confirms pattern. The changes include creating separate publishing channels with confirm mode enabled, along with Ruby version updates and security dependency patches.

  • Implements publisher confirms by calling confirm_select on publishing channels and wait_for_confirms after each publish operation
  • Updates Ruby version from 2.6.6 to 2.6.9 for better stability and security
  • Upgrades critical dependencies (nokogiri, loofah, crass) to address security vulnerabilities

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/acapi/local_amqp_publisher.rb Creates separate @p_channel for publishing with confirm_select enabled; adds wait_for_confirms after publish
lib/acapi/amqp/responder.rb Adds confirm_select and wait_for_confirms to response exchange within with_response_exchange method
lib/acapi/amqp/requestor.rb Creates dedicated p_channel for publishing with confirms; properly closes channel in ensure block
lib/acapi/amqp/client.rb Establishes @republish_channel with confirms for redelivery scenarios
lib/acapi/requestor.rb Improves connection check to verify both presence and connected status
spec/lib/acapi/local_amqp_publisher_spec.rb Adds mocks for confirm_select and wait_for_confirms; changes create_channel expectation to allow for multiple channel creation
.ruby-version Updates Ruby version from 2.6.6 to 2.6.9
.github/workflows/tests.yml Updates Ruby version to 2.6.9 and upgrades actions/cache from v1 to v4
.github/workflows/downstream.yml Removes branches filter from workflow_dispatch to allow manual runs from any branch
Gemfile.lock Updates security-critical dependencies: crass, loofah, nokogiri, and adds racc

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +17
@republish_channel = @channel.connection.create_channel
@republish_channel.confirm_select
@republish_queue = @republish_channel.queue(@queue.name, @queue.options)
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @republish_channel is created during initialization and set up with confirm_select, but there is no corresponding cleanup logic to close this channel. While the connection closing will eventually clean up the channel, consider adding explicit channel cleanup in a cleanup/disconnect method to ensure proper resource management and avoid potential channel leaks in long-running processes.

Copilot uses AI. Check for mistakes.
end
msg = Acapi::Amqp::OutMessage.new(@app_id, name, finished, finished, unique_id, data)
@exchange.publish(*msg.to_message_properties)
@p_channel.wait_for_confirms
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wait_for_confirms call doesn't check the return value or handle potential exceptions. wait_for_confirms returns false if any messages were not confirmed and can raise exceptions like Bunny::NotConnectedError. Consider checking the return value or wrapping this call in error handling to ensure message delivery failures are properly detected and handled.

Copilot uses AI. Check for mistakes.
new_properties = redelivery_properties(existing_retry_count, delivery_info, properties)
queue.publish(payload, new_properties)
@republish_queue.publish(payload, new_properties)
@republish_channel.wait_for_confirms
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wait_for_confirms call doesn't check the return value or handle potential exceptions. wait_for_confirms returns false if any messages were not confirmed and can raise exceptions. The outer rescue block will catch exceptions, but the false return value indicating failed confirmations would be silently ignored, potentially leading to message loss without notification. Consider explicitly checking the return value.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants