Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: abtest 데드락 이슈 발견/해결 #1075

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ ResponseEntity<Void> assignAbtestVariableByAdmin(
@Operation(summary = "(NORMAL) 실험군 편입 정보 확인")
@PostMapping("/assign")
ResponseEntity<AbtestAssignResponse> assignOrGetAbtestVariable(
@RequestHeader("accessHistoryId") Integer accessHistoryId,
@RequestHeader("access_history_id") Integer accessHistoryId,
@UserAgent UserAgentInfo userAgentInfo,
@UserId Integer userId,
@RequestBody @Valid AbtestAssignRequest abtestAssignRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@

import in.koreatech.koin.admin.abtest.model.redis.AbtestVariableAssign;

public interface AbtestVariableAssignRepository extends Repository<AbtestVariableAssign, String> {
public interface AbtestVariableAssignRedisRepository extends Repository<AbtestVariableAssign, String> {

AbtestVariableAssign save(AbtestVariableAssign abtestVariableAssign);

Optional<AbtestVariableAssign> findById(String id);

void deleteById(String id);

default Optional<AbtestVariableAssign> findByVariableIdAndAccessHistoryId(Integer variableId,
Integer accessHistoryId) {
default Optional<AbtestVariableAssign> findByVariableIdAndAccessHistoryId(
Integer variableId,
Integer accessHistoryId
) {
return findById(variableId + DELIMITER + accessHistoryId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import in.koreatech.koin.admin.abtest.model.redis.AbtestVariableCount;

public interface AbtestVariableCountRepository extends CrudRepository<AbtestVariableCount, Integer> {
public interface AbtestVariableCountRedisRepository extends CrudRepository<AbtestVariableCount, Integer> {

List<AbtestVariableCount> findAll();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package in.koreatech.koin.admin.abtest.repository;

import java.util.List;
import java.util.Optional;

import org.springframework.data.repository.Repository;
Expand All @@ -11,6 +12,8 @@ public interface AbtestVariableRepository extends Repository<AbtestVariable, Int

Optional<AbtestVariable> findById(Integer variableId);

List<AbtestVariable> findAllByIdIn(List<Integer> ids);

default AbtestVariable getById(Integer variableId) {
return findById(variableId).orElseThrow(() ->
AbtestVariableNotFoundException.withDetail("AbtestVariable id: " + variableId));
Expand Down
Loading
Loading